apache2-license-checker
v1.0.0
Published
Automated license checker for validating project dependencies for compatable Apache2 licenses.
Readme
Apache2 License Checker
Automated license checker for validating project dependencies for compatible Apache2 licenses.
Use with your project
- Run
npm install apache2-license-checker --save-dev - Run
apache2-license-checkerin the root of your project - Modify your
package.jsonto includeapache2-license-checkeras part of your test script
For example:
...
"scripts": {
"test": "mocha && npm run check-licenses",
"check-licenses": "apache2-license-checker"
},
...The license checker will fail with an exit code of 1 if there are any problems with the license, and will pass with an exit code of 0 if all checks are ok.
A temporary file licenses.json will be created containing a full license analysis based on output from the license-checker tool.
Development
- Check out the code
- Run
npm install - Run
npm test
Modify scripts/whitelist.js to allow additional licenses or license combinations.
Modify scripts/exceptions.js to allow specific modules for a given reason.
Example output
Acceptable project licenses (uses):
(MIT AND CC-BY-3.0) (1)
Apache-2.0 (3)
BSD-2-Clause (1)
BSD-3-Clause (1)
ISC (15)
MIT (23)
Unlicense (1)
WTFPL (1)
Acceptable project license exceptions:
[email protected]
Reason: Not required, acceptable use for BBC internal deployments
[email protected]
Reason: Public Domain; see: https://github.com/dscape/cycle/
[email protected]
Reason: MIT License; see: https://github.com/dominictarr/map-stream
All licenses ok Licensed (46) Exceptions (0) Problems (0)