Ever needed to see all the license info for a module and it's dependencies?
It's this easy:
npm install -g license-checker
mkdir foo
cd foo
npm install yui-lint
license-checker
You should see something like this:
scanning ./yui-lint
├─ [email protected]
│ ├─ repository: http://github.com/chriso/cli
│ └─ licenses: MIT
├─ [email protected]
│ ├─ repository: https://github.com/isaacs/node-glob
│ └─ licenses: UNKNOWN
├─ [email protected]
│ ├─ repository: https://github.com/isaacs/node-graceful-fs
│ └─ licenses: UNKNOWN
├─ [email protected]
│ ├─ repository: https://github.com/isaacs/inherits
│ └─ licenses: UNKNOWN
├─ [email protected]
│ └─ licenses: MIT
├─ [email protected]
│ ├─ repository: https://github.com/isaacs/node-lru-cache
│ └─ licenses: MIT
├─ [email protected]
│ ├─ repository: https://github.com/isaacs/node-lru-cache
│ └─ licenses: MIT
├─ [email protected]
│ ├─ repository: https://github.com/isaacs/minimatch
│ └─ licenses: MIT
├─ [email protected]
│ ├─ repository: https://github.com/isaacs/minimatch
│ └─ licenses: MIT
├─ [email protected]
│ ├─ repository: https://github.com/isaacs/sigmund
│ └─ licenses: UNKNOWN
└─ [email protected]
├─ licenses: BSD
└─ repository: http://github.com/yui/yui-lint
You can also specify --unknown
to only show licenses that it can't determine or guessed at (from README)
Also supports --json /path/to/save.json
to export the data.
Added support for --csv /path/to/save.csv
to export the data as comma-separated values.
var checker = require('license-checker');
checker.init({
start: '/path/to/start/looking'
}, function(json) {
//The sorted json data
});