Detect the license of node.js projects and their dependencies
node-license-sniffer is a tool for detecting the license of node packages.
It will attempt to read the license from
If it cannot find the license in
it will read
LICENSE and similarly named files and attempt to guess the license in use.
npm install license-sniffer
node-license-sniffer [package-dir] [--js-comment] [--recurse] [--body] [--no-generate-body]
package-dir-- the directory of the package. Defaults to the current directory.
--js-comment-- prepend all output with
--recurse-- find the license for the specified package, and its dependencies.
--body-- include the body of each license where possible.
--no-generate-body-- by default,
--bodygenerates the body of known licenses if the license body is not included in the package. Use this option to only include license bodies if they're explicitly included in the package.
Running node-license-sniffer in its own directory:
$ node-license-sniffer BSD
--body (truncated for brevity):
$ node-license-sniffer --js-comment --body // BSD // // Copyright (c) 2013, Michael Williamson // All rights reserved. // // Redistribution and use in source and binary forms...
$ node-license-sniffer node_modules/optimist --recurse Module: email@example.com License: MIT/X11 Module: firstname.lastname@example.org => email@example.com License: MIT/X11