Skip to content

HansHammel/license-compatibility-checker

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
Jan 16, 2017
dev
Jul 5, 2018
Jan 8, 2017
lib
Feb 4, 2021
Jan 5, 2017
Feb 4, 2021
Jan 4, 2017
Jan 8, 2017
Jan 4, 2017
Feb 4, 2021

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.

NPM NPM

Build Status npm version npm license npm download npm download Package Quality Inline docs star this repo fork this repo david dependency david devDependency david optionalDependency david peerDependency npms score Known Vulnerabilities

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 node_modules (no recursive search). Checks for unlicensed or unknown licenses.

Screenshot with sample data (some licenses changed for demo) Screenshot

Install

npm install license-compatibility-checker -g

or better

npm install license-compatibility-checker --save-dev

or

npm install https://github.com/HansHammel/license-compatibility-checker.git --save-dev

Usage

CLI

In your project folder run

license-compatibility-checker

or

lcc PATH_TO_PACKAGE_JSON

or (win)

.\node_modules\.bin\lcc ..\droppy\package.json c:/l/droppy/node_modules

or (*nix)

./node_modules/.bin/lcc PATH_TO_PACKAGE_JSON PATH_TO_MODULES

etc.

Supports to optional parameters:

  1. path to package json (defaults to ./package.json)
  2. path to node_modules (defaults to ./node_modules)

Paths can be relative to the CWD and/or mixed Win/nix-style

As Module

v0.2.x

var lcc = require('license-compatibility-checker');
var path = require('path');
lcc.check(path.join(process.cwd(),'package.json'), path.join(process.cwd(),"node_modules"),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

var lcc = require('license-compatibility-checker');
var path=require('path');
lcc.check(path.join(process.cwd(),'package.json'), path.join(process.cwd(),"node_modules"));

Legal notice

use without warranty

Honorable Mention

Based on license-compatibility ruby gem by Libraries.io

A License Overview

Licences

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published