
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
license-checker-dkbcodefactory
Advanced tools
Feature enhanced version of the original license-checker v25.0.1
This is a fork of davglass' license-checker v.25.0.1
- I simply added a new option --relativeModulePath
for stripping the local absolute path portions from modules (--relativeLicensePath
already does this for the license file paths). Since that module doesn't seem to be updated regularly, I created this module for use in our workplace. A pull request has also been created for bringing that new option into the original module (see https://github.com/davglass/license-checker/pull/223). Also, I upgraded several node modules for this fork that are not upgraded in the original module. The latter is not part of my pull request.
As of v26.0.0 the exclude
argument has been changed into excludeLicenses
in order to prevent confusion and better align it with the excludePackages
argument. Also, the argument includeLicenses
has been added for listing only packages that include the licenses listed.
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-dkbcodefactory
mkdir foo
cd foo
npm install yui-lint
license-checker-dkbcodefactory
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 [filepath]
path of the initial json to look for--unknown
report guessed licenses as unknown licenses.--onlyunknown
only list packages with unknown or guessed licenses.--markdown
output in markdown format.--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.--files [path]
copy all license files to path and rename them to module-name
@version
-LICENSE.txt.--customPath
to add a custom Format file in JSON--excludeLicenses [list]
exclude modules which licenses are in the comma-separated list from the output--includeLicenses [list]
include only modules which licenses are in the comma-separated list from the output--relativeLicensePath
output the location of the license files as relative paths--relativeModulePath
output the location of the module 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--includePackages [list]
restrict output to the packages (either "package@fullversion" or "package@majorversion" or only "package") in the semicolon-seperated list--excludePackages [list]
restrict output to the packages (either "package@fullversion" or "package@majorversion" or only "package") not in the semicolon-seperated list--excludePrivatePackages
restrict output to not include any package marked as private--direct
look for direct dependencies onlyA 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-dkbcodefactory --json > /path/to/licenses.json
license-checker-dkbcodefactory --csv --out /path/to/licenses.csv
license-checker-dkbcodefactory --unknown
license-checker-dkbcodefactory --customPath customFormatExample.json
license-checker-dkbcodefactory --excludeModules 'MIT, MIT OR X11, BSD, ISC'
license-checker-dkbcodefactory --includePackages 'react@16.3.0;react-dom@16.3.0;lodash@4.3.1'
license-checker-dkbcodefactory --excludePackages 'internal-1;internal-2'
license-checker-dkbcodefactory --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.
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
}
}
);
license-checker uses debug for internal logging. There’s two internal markers:
license-checker-dkbcodefactory:error
for errorslicense-checker-dkbcodefactory:log
for non-errorsSet the DEBUG
environment variable to one of these to see debug output:
$ export DEBUG=license-checker-dkbcodefactory*; license-checker-dkbcodefactory
scanning ./yui-lint
├─ cli@0.4.3
│ ├─ repository: http://github.com/chriso/cli
│ └─ licenses: MIT
# ...
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.
FAQs
Feature enhanced version of the original license-checker v25.0.1
The npm package license-checker-dkbcodefactory receives a total of 0 weekly downloads. As such, license-checker-dkbcodefactory popularity was classified as not popular.
We found that license-checker-dkbcodefactory demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.