Finds licenses in a node project and its dependencies
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-license-finder --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-license-finder');
In your project's Gruntfile, add a section named license_finder
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
license_finder: {
all:
options: {
// Task-specific options go here.
}
}
},
});
Type: String
Default value: current project directory
A string value for the path of the node project to scan
Type: Boolean
Default value: false
A boolean value. If true, only production dependencies are included in the scan
Type: String
Default value: ./licenses.txt
A string value for the filename of the output of the scan.
Type: Boolean
Default value: ./licenses.txt
A boolean value. If true the output is in a comma-separated-variable format for import into a spreadsheet.
Type: Number
Default value: if undefined this defaults to infinite
The maximum depth of node_modules to traverse, 0 means the immediate dependencies, add 1 per module depth
Example
grunt.initConfig({
license_finder: {
all: {
options: {
production: true,
directory: '/Home/me/some-project',
out: '/Home/me/some-project/licenses.txt',
csv: true
}
}
}
});
[email protected] [license(s): MIT] └── readme files: MIT [email protected] [license(s): BSD] └── license files: BSD [email protected] [license(s): BSD] ├── package.json: BSD └── license files: BSD [email protected] [license(s): MIT/X11] └── package.json: MIT/X11 [email protected] [license(s): BSD] ├── package.json: BSD └── license files: BSD [email protected] [license(s): MIT] └── readme files: MIT
For output in CSV format use the csv: true option.