1 | # spdx-license-ids
|
2 |
|
3 | [](https://www.npmjs.com/package/spdx-license-ids)
|
4 | [](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/jslicense/spdx-license-ids)
|
5 |
|
6 | A list of [SPDX license](https://spdx.org/licenses/) identifiers
|
7 |
|
8 | ## Installation
|
9 |
|
10 | [Download JSON directly](https://raw.githubusercontent.com/jslicense/spdx-license-ids/main/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/):
|
11 |
|
12 | ```
|
13 | npm install spdx-license-ids
|
14 | ```
|
15 |
|
16 | ## [Node.js](https://nodejs.org/) API
|
17 |
|
18 | ### require('spdx-license-ids')
|
19 |
|
20 | Type: `string[]`
|
21 |
|
22 | All license IDs except for the currently deprecated ones.
|
23 |
|
24 | ```javascript
|
25 | const ids = require('spdx-license-ids');
|
26 | //=> ['0BSD', 'AAL', 'ADSL', 'AFL-1.1', 'AFL-1.2', 'AFL-2.0', 'AFL-2.1', 'AFL-3.0', 'AGPL-1.0-only', ...]
|
27 |
|
28 | ids.includes('BSD-3-Clause'); //=> true
|
29 | ids.includes('CC-BY-1.0'); //=> true
|
30 |
|
31 | ids.includes('GPL-3.0'); //=> false
|
32 | ```
|
33 |
|
34 | ### require('spdx-license-ids/deprecated')
|
35 |
|
36 | Type: `string[]`
|
37 |
|
38 | Deprecated license IDs.
|
39 |
|
40 | ```javascript
|
41 | const deprecatedIds = require('spdx-license-ids/deprecated');
|
42 | //=> ['AGPL-1.0', 'AGPL-3.0', 'GFDL-1.1', 'GFDL-1.2', 'GFDL-1.3', 'GPL-1.0', 'GPL-2.0', ...]
|
43 |
|
44 | deprecatedIds.includes('BSD-3-Clause'); //=> false
|
45 | deprecatedIds.includes('CC-BY-1.0'); //=> false
|
46 |
|
47 | deprecatedIds.includes('GPL-3.0'); //=> true
|
48 | ```
|
49 |
|
50 | ## License
|
51 |
|
52 | [Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/deed)
|