• Stars
    star
    1,593
  • Rank 29,367 (Top 0.6 %)
  • Language
    JavaScript
  • License
    Other
  • Created almost 12 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Check NPM package licenses

NPM License Checker

Build Status

As of v17.0.0 the failOn and onlyAllow arguments take semicolons as delimeters instead of commas. Some license names contain commas and it messed with the parsing

Ever needed to see all the license info for a module and its dependencies?

It's this easy:

npm install -g license-checker

mkdir foo
cd foo
npm install yui-lint
license-checker

You should see something like this:

├─ [email protected]
│  ├─ repository: http://github.com/chriso/cli
│  └─ licenses: MIT
├─ [email protected]
│  ├─ repository: https://github.com/isaacs/node-glob
│  └─ licenses: UNKNOWN
├─ [email protected]
│  ├─ repository: https://github.com/isaacs/node-graceful-fs
│  └─ licenses: UNKNOWN
├─ [email protected]
│  ├─ repository: https://github.com/isaacs/inherits
│  └─ licenses: UNKNOWN
├─ [email protected]
│  └─ licenses: MIT
├─ [email protected]
│  ├─ repository: https://github.com/isaacs/node-lru-cache
│  └─ licenses: MIT
├─ [email protected]
│  ├─ repository: https://github.com/isaacs/node-lru-cache
│  └─ licenses: MIT
├─ [email protected]
│  ├─ repository: https://github.com/isaacs/minimatch
│  └─ licenses: MIT
├─ [email protected]
│  ├─ repository: https://github.com/isaacs/minimatch
│  └─ licenses: MIT
├─ [email protected]
│  ├─ repository: https://github.com/isaacs/sigmund
│  └─ licenses: UNKNOWN
└─ [email protected]
   ├─ licenses: BSD
      └─ repository: http://github.com/yui/yui-lint

An asterisk next to a license name means that it was deduced from an other file than package.json (README, LICENSE, COPYING, ...) You could see something like this:

└─ [email protected]
   ├─ repository: https://github.com/visionmedia/debug
   └─ licenses: MIT*

Options

  • --production only show production dependencies.
  • --development only show development dependencies.
  • --start [path of the initial json to look for]
  • --unknown report guessed licenses as unknown licenses.
  • --onlyunknown only list packages with unknown or guessed licenses.
  • --json output in json format.
  • --csv output in csv format.
  • --csvComponentPrefix prefix column for component in csv format.
  • --out [filepath] write the data to a specific file.
  • --customPath to add a custom Format file in JSON
  • --exclude [list] exclude modules which licenses are in the comma-separated list from the output
  • --relativeLicensePath output the location of the license files as relative paths
  • --summary output a summary of the license usage',
  • --failOn [list] fail (exit with code 1) on the first occurrence of the licenses of the semicolon-separated list
  • --onlyAllow [list] fail (exit with code 1) on the first occurrence of the licenses not in the semicolon-seperated list
  • --packages [list] restrict output to the packages (package@version) in the semicolon-seperated list
  • --excludePackages [list] restrict output to the packages (package@version) not in the semicolon-seperated list
  • --excludePrivatePackages restrict output to not include any package marked as private
  • --direct look for direct dependencies only

Exclusions

A list of licenses is the simplest way to describe what you want to exclude.

You can use valid SPDX identifiers. You can use valid SPDX expressions like MIT OR X11. You can use non-valid SPDX identifiers, like Public Domain, since npm does support some license strings that are not SPDX identifiers.

Examples

license-checker --json > /path/to/licenses.json
license-checker --csv --out /path/to/licenses.csv
license-checker --unknown
license-checker --customPath customFormatExample.json
license-checker --exclude 'MIT, MIT OR X11, BSD, ISC'
license-checker --packages '[email protected];[email protected];[email protected]'
license-checker --excludePackages 'internal-1;internal-2'
license-checker --onlyunknown

Custom format

The --customPath option can be used with CSV to specify the columns. Note that the first column, module_name, will always be used.

When used with JSON format, it will add the specified items to the usual ones.

The available items are the following:

  • name
  • version
  • description
  • repository
  • publisher
  • email
  • url
  • licenses
  • licenseFile
  • licenseText
  • licenseModified

You can also give default values for each item. See an example in customFormatExample.json.

Requiring

var checker = require('license-checker');

checker.init({
    start: '/path/to/start/looking'
}, function(err, packages) {
    if (err) {
        //Handle error
    } else {
        //The sorted package data
        //as an Object
    }
});

Debugging

license-checker uses debug for internal logging. There’s two internal markers:

  • license-checker:error for errors
  • license-checker:log for non-errors

Set the DEBUG environment variable to one of these to see debug output:

$ export DEBUG=license-checker*; license-checker
scanning ./yui-lint
├─ [email protected]
│  ├─ repository: http://github.com/chriso/cli
│  └─ licenses: MIT
# ...

How Licenses are Found

We walk through the node_modules directory with the read-installed module. Once we gathered a list of modules we walk through them and look at all of their package.json's, We try to identify the license with the spdx module to see if it has a valid SPDX license attached. If that fails, we then look into the module for the following files: LICENSE, LICENCE, COPYING, & README.

If one of the those files are found (in that order) we will attempt to parse the license data from it with a list of known license texts. This will be shown with the * next to the name of the license to show that we "guessed" at it.

More Repositories

1

doorbot

Ring.com Doorbell API
JavaScript
316
star
2

zipcodes

Zipcode lookup node module
JavaScript
155
star
3

bambu-farm

BambuLab Web Interface for multiple printers
JavaScript
85
star
4

cpr

Nodejs cp -R
JavaScript
79
star
5

express-session-mongo

MongoDB session storage for ExpressJS
JavaScript
73
star
6

yui-express

Example YUI 3 based View engine for ExpressJS
JavaScript
68
star
7

prettysize

Helper utility to provide pretty printed file sizes
JavaScript
65
star
8

registry-static

static npm registry
JavaScript
60
star
9

bambu-cli

CLI tool for Bambu Labs printers
JavaScript
58
star
10

twimapd

IMAP server based on Twitter statuses
Python
54
star
11

lcov-parse

Simple LCOV file parser
JavaScript
53
star
12

git-travis

Git subcommand to show travis build status
JavaScript
52
star
13

express-extras

ExpressJS Extras
JavaScript
37
star
14

yui-examples

My YUI Examples
JavaScript
34
star
15

node-getrusage

C++ Port of Unix getrusage for getting cputime, usertime and other process information
C++
33
star
16

express-dust

DustJS Renderer for ExpressJS
JavaScript
29
star
17

yui-git

git addon script to help with contributing to YUI
27
star
18

selenium-grid-status

Selenium Grid Status
HTML
22
star
19

node-lsof

Process lsof parser (DEPRECATED)
JavaScript
21
star
20

lightshowpi

Dav's LightShowPi Setup
Python
20
star
21

yui-yql

YQL module for YUI3
JavaScript
19
star
22

nodejs-yui3loader

Serverside YUI 3 combo server written in YUI 3
JavaScript
18
star
23

yui-repl

A NodeJS REPL environment preloaded with a Y variable populated by a YUI sandbox.
JavaScript
16
star
24

trac2issues

Trac to GitHub Issues import script
Python
16
star
25

dotvim

My .vim Directory
Vim Script
15
star
26

nodejs-termcolors

Add terminal color support to command line node.js
JavaScript
14
star
27

echoecho

Simple server reponse echoer to help when testing.
JavaScript
14
star
28

vagrant

Node.js passthru for vagrant CLI access
JavaScript
13
star
29

titweeter

Titanium Mobile Twitter Client
JavaScript
9
star
30

trac-php

A PHP frontend to Trac
PHP
8
star
31

yui-effects

Dav's YUI Effects Package
JavaScript
8
star
32

yui-dhtml-forms

Dav's YUI DHTML Forms Package
JavaScript
7
star
33

yui3-examples

Dav's YUI3 Examples
PHP
7
star
34

yuidoc-app

Cocoa GUI for YUIDoc
Python
7
star
35

loader-alone

Prototype of YUILoader as a standalone module.
JavaScript
7
star
36

davglass.github.com

GitHub Pages
6
star
37

yui-tools

Dav's YUI Tools Source
JavaScript
6
star
38

yui-dev-combo

YUI Development Combo Server
PHP
6
star
39

yui-node-extras

JavaScript
6
star
40

yui-code-editor

This is the new home of the YUI RTE Code Editor project
JavaScript
6
star
41

bp-profiler

BrowserPlus based Javascript Profiler
C++
6
star
42

cssproc

CSS URL processor
JavaScript
6
star
43

rbot-plugins

Home of my rbot plugins used in #yui
Ruby
6
star
44

vbox

VirtualBox helper tools
Shell
6
star
45

follow-registry

npm registry follower
JavaScript
6
star
46

php-customevent

Porting YUI's Custom Event modal to PHP
5
star
47

yuibot

YUI IRC Bot
JavaScript
5
star
48

bp-jslint

BrowserPlus based JSLint tool
JavaScript
5
star
49

yui-node-effects

4
star
50

bp-apache

BrowserPlus local Apache server
Ruby
4
star
51

express-yui-serve

Middleware for express that allows you to serve YUI locally from the installed node package.
JavaScript
4
star
52

yui-local

Simple dev-time local YUI combo handler
JavaScript
4
star
53

yui-sortable

Dav's YUI Sortable Package
PHP
4
star
54

st-beacon-bacon

SmartThings Beacon
Groovy
4
star
55

yui-capture

YUI Event Capture
JavaScript
4
star
56

yui-devtools

YUI Dev Time Tools Collection
JavaScript
4
star
57

openhackday

London Open Hack Day talk
JavaScript
3
star
58

st-glance

My Home at a Glance
Groovy
3
star
59

st-logger

SmartThings CLI Live Log Viewer
JavaScript
3
star
60

bp-pastebuffer

This plugin grabs an image from your clipboard and returns it to the browser.
3
star
61

yui-coverage

YUI Developer Utility
JavaScript
3
star
62

yui-cli

Command line YUI file combiner
JavaScript
3
star
63

yuidoc-extended

JavaScript
3
star
64

yui3-meta-builder

JavaScript
3
star
65

timethat

print time from one date to another (elapsed time)
JavaScript
3
star
66

gitdo

3
star
67

jslint-service

Web Service for JSLint
JavaScript
3
star
68

quickyui

QuickYUI
3
star
69

st-windows

Are My Windows Open?
Groovy
2
star
70

zoneminder-api

ZoneMinder API
JavaScript
2
star
71

checkip

Get's your current IP address (if behind a NAT).
JavaScript
2
star
72

yui3-sandbox

My YUI Sandbox
JavaScript
2
star
73

st-garagedoor

Groovy
2
star
74

bp-sreader

Screen Reader Detection
Ruby
2
star
75

yui3-debugger

2
star
76

yuipm

YUI Package Manager for NPM
JavaScript
2
star
77

format-package-json

JavaScript
2
star
78

ydn-github-post

This is a work in progress blog post for the yahoo! developer network about git and github.
2
star
79

yui2-pack

YUI 2 project - Packed - Test - Ignore me
1
star
80

davargs

JavaScript
1
star
81

st-toggle

Groovy
1
star
82

st-arduino-doorchime

Arduino
1
star
83

titanium_textarea

Demo app showing my changes to Titaniums TextArea
JavaScript
1
star
84

patch-package-json

JavaScript
1
star
85

st-doorlights

Groovy
1
star
86

hack

Live coding example from Yahoo Hack USA
JavaScript
1
star
87

yui-master-combo

YUI Master Combo Handler
JavaScript
1
star
88

yogi-foo

Example of a yogi sub command
JavaScript
1
star
89

st-bathrooms

Groovy
1
star
90

st-modechange

Groovy
1
star
91

alloy-build

AlloyUI Build Help
JavaScript
1
star
92

check_couchdb

Nagios command for couchdb
JavaScript
1
star