Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

licensee

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

licensee - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

configuration-schema.json

49

package.json
{
"name": "licensee",
"description": "check npm package licenses against a set of rules",
"version": "0.2.0",
"author": {
"name": "Kyle E. Mitchell",
"email": "kyle@kemitchell.com",
"url": "http://kemitchell.com"
},
"bin": "./bin/licensee",
"bugs": "https://github.com/jslicense/licensee.js/issues",
"description": "check dependency licenses against rules",
"version": "1.0.0",
"author": "Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com/)",
"dependencies": {
"cli-table": "^0.3.1",
"docopt": "0.6.2",
"read-installed": "4.0.0",
"spdx": "0.4.0"
"read-package-tree": "^5.1.2",
"semver": "^5.1.0",
"spdx-expression-validate": "^1.0.1",
"spdx-satisfies": "^0.1.3",
"tv4": "^1.2.7"
},
"bin": "./licensee",
"files": [
"LICENSE",
"NOTICE",
"configuration-schema.json",
"index.js",
"licensee"
],
"devDependencies": {
"jscs": "1.13.1",
"jshint": "2.7.0",
"tap": "1.0.2",
"temp": "0.8.1"
"tap": "^5.4.2"
},
"homepage": "https://github.com/jslicense/licensee.js",
"keywords": [
"SPDX",
"audit",
"law",
"legal",
"license",
"metadata",
"package"
],
"license": "Apache-2.0",
"main": "source/index.js",
"repository": "jslicense/licensee.js",
"scripts": {
"lint": "jshint source test && jscs source test",
"precommit": "npm run lint && npm run test",
"test": "tap test/*.test.js"
"test": "tap tests/**/test.js"
}
}

@@ -1,31 +0,67 @@

licensee.js
===========
Check dependency licenses against rules.
[![npm version](https://img.shields.io/npm/v/licensee.svg)](https://www.npmjs.com/package/licensee)
[![license](https://img.shields.io/badge/license-Apache--2.0-303284.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![build status](https://img.shields.io/travis/jslicense/licensee.js.svg)](http://travis-ci.org/jslicense/licensee.js)
# Configuration
Check npm package licenses against a set of rules.
Create a `.licensee.json` file at the root of your package. Here is an example.
At the command line:
```json
{ "license": "(MIT OR BSD-2-Clause OR BSD-3-Clause OR ISC OR Apache-2.0)",
"whitelist": {
"optimist": "<=0.6.1" } }
```
The `license` property is an SPDX license expression that
[spdx-expression-parse][parse] can parse. Any package with [standard
license metadata][metadata] that satisfies the SPDX license expression
according to [spdx-satisfies][satisfies] will not cause an error.
[parse]: https://www.npmjs.com/package/spdx-expression-parse
[satisfies]: https://www.npmjs.com/package/spdx-satisfies
The `whitelist` is a map from package name to a [node-semver][semver]
Semantic Versioning range. Packages whose license metadata don't match
the SPDX license expression in `license` but have a name and version
described in `whitelist` will not cause an error.
[metadata]: https://docs.npmjs.com/files/package.json#license
[semver]: https://www.npmjs.com/package/semver
# Use
To install and use `licensee` globally:
```bash
npm --global install licensee
cd /your/package/path
npm install --global licensee
cd your-package
licensee
```
With Node.js:
The `licensee` script will exit with status `0` when all packages in
`./node_modules` meet the configured licensing criteria and `1` when
one or more do not.
```js
var licensee = require('licensee');
var path = '/your/package/path';
var configuration = {
link: '(MIT OR ISC OR Apache-2.0)'
};
licensee(path, configuration, function(error, problems) {
console.error(problems);
});
To install it as a development dependency of your package:
```bash
cd your-package
npm install --save-dev licensee
```
`licensee` checks `license` properties in `package.json` metadata. Licensing of packages with `private: true` is ignored.
Consider adding `licensee` to your npm scripts:
```json
{ "scripts": {
"test": "...",
"posttest": "licensee" } }
```
# JavaScript Module
The package exports an asynchronous function of three arguments:
1. A configuration object in the same form as `.licensee.json`.
2. The path of the package to check.
3. An error-first callback that yields an array of objects describing
licensing issues.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc