Skip to content

Commit

Permalink
Add just a few examples back to README
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitchell committed Sep 21, 2023
1 parent 5a7b02f commit 58a802d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
`satisfies(SPDX license expression, array of approved licenses)`

Approved licenses may be simple license identifiers like `MIT`, plus-ranges like `EPL-2.0+`, or licenses with exceptions like `Apache-2.0 WITH LLVM`. They may _not_ be compound expressions using `AND` or `OR`.

```javascript
var assert = require('assert')
var satisfies = require('spdx-satisfies')

assert(satisfies('MIT', ['MIT', 'ISC', 'BSD-2-Clause', 'Apache-2.0']))
assert(satisfies('GPL-2.0 OR MIT', ['MIT']))
assert(!satisfies('GPL-2.0 AND MIT', ['MIT']))
assert(satisfies('GPL-3.0', ['GPL-2.0+']))
assert(!satisfies('GPL-1.0', ['GPL-2.0+']))
```
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"spdx-ranges": "^2.0.0"
},
"devDependencies": {
"defence-cli": "^3.0.1",
"replace-require-self": "^1.1.1",
"standard": "^11.0.0"
},
"keywords": [
Expand All @@ -32,7 +34,9 @@
"index.js"
],
"scripts": {
"test": "node test.js",
"test": "npm run test:suite && npm run test:readme",
"test:suite": "node test.js",
"test:readme": "defence -i javascript README.md | replace-require-self | node",
"lint": "standard"
}
}

0 comments on commit 58a802d

Please sign in to comment.