GithubHelp home page GithubHelp logo

license-checker's Introduction

NPM License Checker

Ever needed to see all the license info for a module and it's 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

Options

  • --production only show production dependencies.
  • --development only show development dependencies.
  • --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.
  • --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

Examples

license-checker --json > /path/to/licenses.json
license-checker --csv --out /path/to/licenses.csv
license-checker --unknown
license-checker --customPath customFormatExample.js 
license-checker --exclude 'MIT, MIT/X11, BSD, ISC'
license-checker --onlyunknown

Requiring

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

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

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
# ...

build status

Build Status

license-checker's People

Contributors

davglass avatar timoxley avatar swashcap avatar tmpvar avatar paulmand3l avatar senotrusov avatar couchand avatar garrows avatar jamesbloomer avatar mwilliamson avatar yzapuchlak avatar gdw2 avatar

Watchers

Eric Chan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.