spdx-license-list
TypeScript icon, indicating that this package has built-in type declarations

6.9.0 • Public • Published

spdx-license-list

List of SPDX licenses

The lists of licenses are just JSON files and can be used anywhere.

Using SPDX License List version 3.23 (2024-02-08)

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
6.9.0253,700latest

Version History

VersionDownloads (Last 7 Days)Published
6.9.0253,700
6.8.08,553
6.7.011,425
6.6.063,224
6.5.0453
6.4.01,315
6.3.0267
6.2.0130
6.1.0105
6.0.045
5.0.02,138
4.1.0474
4.0.01
3.0.1571
3.0.00
2.1.06,640
2.0.00
1.1.047
1.0.00

Package Sidebar

Install

npm i spdx-license-list

Weekly Downloads

349,088

Version

6.9.0

License

CC0-1.0

Unpacked Size

9.97 MB

Total Files

650

Last publish

Collaborators

  • sindresorhus