Gathering detailed insights and metrics for license-checker
Gathering detailed insights and metrics for license-checker
Gathering detailed insights and metrics for license-checker
Gathering detailed insights and metrics for license-checker
@types/license-checker
TypeScript definitions for license-checker
license-checker-rseidelsohn
Extract NPM package licenses - Feature enhanced version of the original license-checker v25.0.1
@types/license-checker-webpack-plugin
TypeScript definitions for license-checker-webpack-plugin
js-green-licenses
JavaScript package.json license checker
npm install license-checker
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,609 Stars
377 Commits
214 Forks
19 Watching
3 Branches
45 Contributors
Updated on 26 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-3.1%
97,796
Compared to previous day
Last week
-0.9%
517,049
Compared to previous week
Last month
16.6%
2,156,755
Compared to previous month
Last year
1.8%
22,980,391
Compared to previous year
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:
1npm install -g license-checker 2 3mkdir foo 4cd foo 5npm install yui-lint 6license-checker
You should see something like this:
├─ cli@0.4.3
│ ├─ repository: http://github.com/chriso/cli
│ └─ licenses: MIT
├─ glob@3.1.14
│ ├─ repository: https://github.com/isaacs/node-glob
│ └─ licenses: UNKNOWN
├─ graceful-fs@1.1.14
│ ├─ repository: https://github.com/isaacs/node-graceful-fs
│ └─ licenses: UNKNOWN
├─ inherits@1.0.0
│ ├─ repository: https://github.com/isaacs/inherits
│ └─ licenses: UNKNOWN
├─ jshint@0.9.1
│ └─ licenses: MIT
├─ lru-cache@1.0.6
│ ├─ repository: https://github.com/isaacs/node-lru-cache
│ └─ licenses: MIT
├─ lru-cache@2.0.4
│ ├─ repository: https://github.com/isaacs/node-lru-cache
│ └─ licenses: MIT
├─ minimatch@0.0.5
│ ├─ repository: https://github.com/isaacs/minimatch
│ └─ licenses: MIT
├─ minimatch@0.2.9
│ ├─ repository: https://github.com/isaacs/minimatch
│ └─ licenses: MIT
├─ sigmund@1.0.0
│ ├─ repository: https://github.com/isaacs/sigmund
│ └─ licenses: UNKNOWN
└─ yui-lint@0.1.1
├─ 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:
└─ debug@2.0.0
├─ repository: https://github.com/visionmedia/debug
└─ licenses: MIT*
--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
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.
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 'react@16.3.0;react-dom@16.3.0;lodash@4.3.1'
license-checker --excludePackages 'internal-1;internal-2'
license-checker --onlyunknown
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:
You can also give default values for each item. See an example in customFormatExample.json.
1var checker = require('license-checker'); 2 3checker.init({ 4 start: '/path/to/start/looking' 5}, function(err, packages) { 6 if (err) { 7 //Handle error 8 } else { 9 //The sorted package data 10 //as an Object 11 } 12});
license-checker uses debug for internal logging. There’s two internal markers:
license-checker:error
for errorslicense-checker:log
for non-errorsSet the DEBUG
environment variable to one of these to see debug output:
1$ export DEBUG=license-checker*; license-checker 2scanning ./yui-lint 3├─ cli@0.4.3 4│ ├─ repository: http://github.com/chriso/cli 5│ └─ licenses: MIT 6# ...
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.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 7/25 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More