A quick way to see the licenses of modules you depend on—recursively.
npm -g install licensecheck
.
licensecheck [-m/--missing-only] [-h/--highlight regexp] [optional dir]
-m / --missing-only : only list licenses that are unspecified
-h regexp / --highlight regexp : highlight licenses entries that match the regular expression (case insensitive)
$ licensecheck
└─ licensecheck (0.2.0) ── zlib ── package.json
├─ colors (0.6.0-1) ── MIT ── node_modules/colors/MIT-LICENSE.txt
├─ markdown (0.4.0) ── MIT (http://www.opensource.org/licenses/mit-license.php) ── node_modules/markdown/package.json
│ └─ nopt (1.0.10) ── MIT (https://github.com/isaacs/nopt/raw/master/LICENSE) ── node_modules/markdown ~ nopt/package.json
│ └─ abbrev (1.0.4) ── MIT (https://github.com/isaacs/abbrev-js/raw/master/LICENSE) ── node_modules/markdown ~ nopt ~ abbrev/package.json
└─ treeify (0.4.2) ── MIT (http://lp.mit-license.org/) ── node_modules/treeify/package.json
$ licensecheck -f
abbrev (1.0.4) ── MIT (https://github.com/isaacs/abbrev-js/raw/master/LICENSE) ── node_modules/markdown ~ nopt ~ abbrev/package.json
colors (0.6.0-1) ── MIT ── node_modules/colors/MIT-LICENSE.txt
licensecheck (0.2.0) ── zlib ── package.json
markdown (0.4.0) ── MIT (http://www.opensource.org/licenses/mit-license.php) ── node_modules/markdown/package.json
nopt (1.0.10) ── MIT (https://github.com/isaacs/nopt/raw/master/LICENSE) ── node_modules/markdown ~ nopt/package.json
treeify (0.4.2) ── MIT (http://lp.mit-license.org/) ── node_modules/treeify/package.json
Licensecheck looks for license information in the following order:
package.json
"license" fieldpackage.json
"licenses" field- file with
license
in its name - file with
readme
in its name a. if the filename ends in.md
or.markdown
, parses markdown looking for a section withlicense
in its name b. otherwise checks forlicense
in its text
If matching a file (as opposed to package.json
), it looks for substrings that match the license-files
folder (ignoring
case, whitespace, punctuation, etc.).
This is pretty hacky and experimental, so use at your own risk.
License-check is open source software under the [zlib license][1]. [1]: LICENSE