• Home
Name Date Size #Lines LOC

..--

README.mdD12-May-20241.5 KiB5332

deprecated.jsonD12-May-2024434 2524

index.jsonD12-May-20245.2 KiB371370

package.jsonD12-May-20241.9 KiB7877

README.md

1# spdx-license-ids
2
3[![npm version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.com/package/spdx-license-ids)
4[![Github Actions](https://action-badges.now.sh/shinnn/spdx-license-ids)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/shinnn/spdx-license-ids)
5
6A list of [SPDX license](https://spdx.org/licenses/) identifiers
7
8## Installation
9
10[Download JSON directly](https://raw.githubusercontent.com/shinnn/spdx-license-ids/master/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/):
11
12```
13npm install spdx-license-ids
14```
15
16## [Node.js](https://nodejs.org/) API
17
18### require('spdx-license-ids')
19
20Type: `string[]`
21
22All license IDs except for the currently deprecated ones.
23
24```javascript
25const 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
28ids.includes('BSD-3-Clause'); //=> true
29ids.includes('CC-BY-1.0'); //=> true
30
31ids.includes('GPL-3.0'); //=> false
32```
33
34### require('spdx-license-ids/deprecated')
35
36Type: `string[]`
37
38Deprecated license IDs.
39
40```javascript
41const 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
44deprecatedIds.includes('BSD-3-Clause'); //=> false
45deprecatedIds.includes('CC-BY-1.0'); //=> false
46
47deprecatedIds.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)
53