65bfb02c228042c9c44c16b5513c4c43dfe05165802204d51495ebfa23a0856f854b05d2c385e27e69b3a7fbe4ac5326129a96948b8dbb0530ea29b0177f1d 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # spdx-license-ids
  2. [![npm version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.com/package/spdx-license-ids)
  3. A list of [SPDX license](https://spdx.org/licenses/) identifiers
  4. ## Installation
  5. [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/):
  6. ```
  7. npm install spdx-license-ids
  8. ```
  9. ## [Node.js](https://nodejs.org/) API
  10. ### require('spdx-license-ids')
  11. Type: `string[]`
  12. All license IDs except for the currently deprecated ones.
  13. ```javascript
  14. const ids = require('spdx-license-ids');
  15. //=> ['0BSD', 'AAL', 'ADSL', 'AFL-1.1', 'AFL-1.2', 'AFL-2.0', 'AFL-2.1', 'AFL-3.0', 'AGPL-1.0-only', ...]
  16. ids.includes('BSD-3-Clause'); //=> true
  17. ids.includes('CC-BY-1.0'); //=> true
  18. ids.includes('GPL-3.0'); //=> false
  19. ```
  20. ### require('spdx-license-ids/deprecated')
  21. Type: `string[]`
  22. Deprecated license IDs.
  23. ```javascript
  24. const deprecatedIds = require('spdx-license-ids/deprecated');
  25. //=> ['AGPL-1.0', 'AGPL-3.0', 'GFDL-1.1', 'GFDL-1.2', 'GFDL-1.3', 'GPL-1.0', 'GPL-2.0', ...]
  26. deprecatedIds.includes('BSD-3-Clause'); //=> false
  27. deprecatedIds.includes('CC-BY-1.0'); //=> false
  28. deprecatedIds.includes('GPL-3.0'); //=> true
  29. ```
  30. ## License
  31. [Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/deed)