Package Exports
- spdx-license-list
- spdx-license-list/full
- spdx-license-list/full.js
- spdx-license-list/index.js
- spdx-license-list/licenses/ISC
- spdx-license-list/licenses/ISC.json
- spdx-license-list/licenses/MIT
- spdx-license-list/licenses/MIT.json
- spdx-license-list/simple
- spdx-license-list/simple.js
- spdx-license-list/spdx-full
- spdx-license-list/spdx-full.json
- spdx-license-list/spdx-simple.json
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (spdx-license-list) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
spdx-license-list
List of SPDX licenses
The lists of licenses are just JSON files and can be used anywhere.
- spdx.json contains just license metadata
- spdx-full.json includes the license text too
- spdx-simple.json only contains the license IDs
Using SPDX License List version 3.26.0 (2024-12-30)
Install
npm install spdx-license-list
Usage
const spdxLicenseList = require('spdx-license-list');
console.log(spdxLicenseList.MIT);
/*
{
name: 'MIT License',
url: 'http://www.opensource.org/licenses/MIT',
osiApproved: true
}
*/
const mitLicense = require('spdx-license-list/licenses/MIT');
console.log(mitLicense.licenseText);
//=> 'MIT License\r\n\r\nCopyright (c) <year> <copyright holders> …'
You can also get a version with the licence text included:
const spdxLicenseList = require('spdx-license-list/full');
console.log(spdxLicenseList.MIT);
/*
{
name: 'MIT License',
url: 'http://www.opensource.org/licenses/MIT',
osiApproved: true,
licenseText: '…'
}
*/
Or just the license IDs as a Set
:
const spdxLicenseList = require('spdx-license-list/simple');
console.log(spdxLicenseList);
//=> Set {'Glide', 'Abstyles', …}
API
spdxLicenseList
Type: object
The licenses are indexed by their identifier and contains a name
property with the full name of the license, url
with the URL to the license, and osiApproved
boolean for whether the license is OSI Approved.