spdx-license-list

List of SPDX licenses

CC0-1.0 21 个版本
安装
npm install spdx-license-list
yarn add spdx-license-list
pnpm add spdx-license-list
bun add spdx-license-list
README

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.27.0 (2025-07-01)

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.

版本列表
6.11.0 2026-01-14
6.10.0 2025-04-04
6.9.0 2024-02-21
6.8.0 2023-10-30
6.7.0 2023-08-31
6.6.0 2022-06-09
6.5.0 2022-04-04
6.4.0 2021-01-24
6.3.0 2020-09-16
6.2.0 2020-04-16
6.1.0 2019-08-07
6.0.0 2019-03-27
5.0.0 2018-11-08
4.1.0 2018-07-19
4.0.0 2018-01-21
3.0.1 2017-03-15
3.0.0 2017-03-15
2.1.0 2015-10-02
2.0.0 2015-04-29
1.1.0 2014-08-17
1.0.0 2014-08-05