Nuclear Powered Marshmallows
Miss any of our Open RFC calls?Watch the recordings here! »

spdx-license-list

6.3.0 • Public • Published

spdx-license-list Build Status

List of SPDX licenses

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

Using SPDX License List version 3.10 (2020-08-03)

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.

Install

npm i spdx-license-list

DownloadsWeekly Downloads

31,276

Version

6.3.0

License

CC0-1.0

Unpacked Size

8.3 MB

Total Files

454

Last publish

Collaborators

  • avatar