license-compatibility-checker
Check npm dependencies' package.json for license compatibility (aka compliance check) with the current project based on spdx notation and naming conventions.


This is WIP and likely to change but already useable.
Does a simple comparison like Public Domain > Permissive > Weakly Protective > Strongly Protective > Network Protective of the primary dependencies in nodemodules (no recursive search). Checks for unlicensed or unknown licenses. Screenshot with sample data (some licenses changed for demo)
Install
```sh
npm install license-compatibility-checker -g
```
or better
```sh
npm install license-compatibility-checker --save-dev
```
or
```sh
npm install https://github.com/HansHammel/license-compatibility-checker.git --save-dev
```
Usage
CLI
In your project folder run ```bash license-compatibility-checker ``` or ```bash lcc PATHTOPACKAGEJSON ``` or (win) ```bash .\nodemodules\.bin\lcc ..\droppy\package.json c:/l/droppy/nodemodules ``` or (nix) ```bash ./nodemodules/.bin/lcc PATHTOPACKAGEJSON PATHTOMODULES ``` etc. Supports to optional parameters:- path to package json (defaults to ./package.json)
- path to nodemodules (defaults to ./nodemodules)
As Module
v0.2.x
```node var lcc = require('license-compatibility-checker'); var path = require('path'); lcc.check(path.join(process.cwd(),'package.json'), path.join(process.cwd(),"nodemodules"),function(/error/ err,/boolean/ passed,/string/ output){ if (err) console.log(err); else if (passed) {//No license issues found
console.log(output);
} else
{
//License issues found
console.log(output);
//process.exit(1);
//or
//throw new Error('License issues found');
}
});
```
v0.1.1
```node var lcc = require('license-compatibility-checker'); var path=require('path'); lcc.check(path.join(process.cwd(),'package.json'), path.join(process.cwd(),"nodemodules")); ```Legal notice
use without warrantyHonorable Mention
Based on license-compatibility ruby gem by Libraries.ioA License Overview
