Socket
Socket
Sign inDemoInstall

spdx-license-list

Package Overview
Dependencies
0
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    spdx-license-list

List of SPDX licenses


Version published
Weekly downloads
226K
decreased by-4.78%
Maintainers
1
Install size
9.50 MB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 21 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc