A grunt plugin to generate a list of npm dependencies
Перейти к файлу
Hamlet D'Arcy d96b14a485
Merge pull request #2 from microsoft/users/GitHubPolicyService/ed7aaee1-7c5b-4b4c-bc41-b1cb9e88c5a9
Adding Microsoft SECURITY.MD
2022-08-30 15:00:19 +02:00
lib Initial commit 2017-05-19 15:03:45 +02:00
tasks Initial commit 2017-05-19 15:03:45 +02:00
tests Initial commit 2017-05-19 15:03:45 +02:00
.gitattributes Initial commit 2017-05-19 15:03:45 +02:00
.gitignore Initial commit 2017-05-19 15:03:45 +02:00
.npmignore Initial commit 2017-05-19 15:03:45 +02:00
Gruntfile.js Initial commit 2017-05-19 15:03:45 +02:00
LICENSE Initial commit 2017-05-19 15:03:45 +02:00
README.md Initial commit 2017-05-19 15:03:45 +02:00
SECURITY.md Microsoft mandatory file 2022-08-30 09:39:55 +00:00
package.json Update package.json to include the repository 2021-09-08 13:46:07 +08:00

README.md

grunt-generate-license-data

A grunt plugin to list npm packages' dependencies.

Example output:

backbone;production;0.0.1;MIT;https://github.com/jashkenas/backbone;;top-level
jquery;production;3.0.0;MIT;https://github.com/jquery/jquery;;transitive
mocha;build-only;0.0.2;MIT;https://github.com/mochajs/mocha;;top-level
underscore;build-only;1.0.0;MIT;https://github.com/jashkenas/underscore;;transitive

Getting Started

This plugin requires Grunt

npm install grunt-generate-license-data --save-dev

Once the plugin has been installed, it may be enabled inside Gruntfile:

grunt.loadNpmTasks("grunt-generate-license-data");

The "generate-license-data" task

Overview

In Gruntfile.js, add a section named generate-license-data:

grunt.initConfig({
    'generate-license-data': {
        all: {
            options: {
                // options go here
            }
        }
    }
});

Options

  • options.outFile: string - name of output file. Defaults to licenses.csv.
  • options.roots: string[] - array of folders with root npm packages. Defaults to ['.'].
  • options.metadata: { [packageName: string]: { homepage: string, license: string } } - explicitly provide license or homepage.

Usage Example

grunt.initConfig({
    'generate-license-data': {
        all: {
            options: {
                outFile: 'export.csv',
                roots: [ 'module1', 'module2' ],
                metadata: {
                    backbone: {
                        license: 'MIT'
                    }
                }
            }
        }
    }
});

Running

Make sure npm packages are up-to-date npm install and npm prune. Then:

grunt generate-license-data

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.