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

spdx-satisfies

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spdx-satisfies - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

index.js

22

package.json
{
"name": "spdx-satisfies",
"description": "test whether SPDX expressions satisfy licensing criteria",
"version": "0.1.2",
"version": "0.1.3",
"author": "Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com)",
"dependencies": {
"spdx": "0.4.x",
"spdx-compare": "0.1.x"
"spdx-compare": "^0.1.2",
"spdx-expression-parse": "^1.0.0"
},
"devDependencies": {
"jsmd-tape": "^0.1.0",
"tape": "4.x"
"defence-cli": "^1.0.1"
},
"keywords": [
"SPDX",
"law",
"legal",
"license",
"metadata",
"package",
"package.json",
"standards"
],
"license": "MIT",
"main": "spdx-satisfies.js",
"repository": "kemitchell/spdx-satisfies.js",
"scripts": {
"test": "jsmd-tape README.md | node"
"test": "defence -i javascript README.md | sed 's!spdx-satisfies!./!' | node"
}
}

@@ -1,36 +0,28 @@

Test whether SPDX expressions satisfy given licensing criteria
```javascript
var assert = require('assert')
var satisfies = require('spdx-satisfies')
```shellsession
npm install --save spdx-satisfies
```
assert(satisfies('MIT', 'MIT'))
In JavaScript:
assert(satisfies('MIT', '(ISC OR MIT)'))
assert(satisfies('Zlib', '(ISC OR (MIT OR Zlib))'))
assert(!satisfies('GPL-3.0', '(ISC OR MIT)'))
<!--js
var satisfies = require('./');
-->
assert(satisfies('GPL-2.0', 'GPL-2.0+'))
assert(satisfies('GPL-3.0', 'GPL-2.0+'))
assert(!satisfies('GPL-1.0', 'GPL-2.0+'))
```js
satisfies('MIT', 'MIT') // => true
satisfies('MIT', '(ISC OR MIT)') // => true
satisfies('Zlib', '(ISC OR (MIT OR Zlib))') // => true
satisfies('GPL-3.0', '(ISC OR MIT)') // => false
satisfies('GPL-2.0', 'GPL-2.0+') // => true
satisfies('GPL-3.0', 'GPL-2.0+') // => true
satisfies('GPL-1.0', 'GPL-2.0+') // => false
satisfies(
assert(!satisfies(
'GPL-2.0',
'GPL-2.0+ WITH Bison-exception-2.2'
) // => false
satisfies(
))
assert(satisfies(
'GPL-3.0 WITH Bison-exception-2.2',
'GPL-2.0+ WITH Bison-exception-2.2'
) // => true
))
satisfies('(MIT OR GPL-2.0)', '(ISC OR MIT)') // => true
satisfies('(MIT AND GPL-2.0)', '(MIT OR GPL-2.0)') // => true
satisfies('(MIT AND GPL-2.0)', '(ISC OR GPL-2.0)') // => false
assert(satisfies('(MIT OR GPL-2.0)', '(ISC OR MIT)'))
assert(satisfies('(MIT AND GPL-2.0)', '(MIT OR GPL-2.0)'))
assert(!satisfies('(MIT AND GPL-2.0)', '(ISC OR GPL-2.0)'))
```
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