What is spdx-license-ids?
The spdx-license-ids package provides a list of SPDX license identifiers. SPDX (Software Package Data Exchange) is a standard format for communicating the licensing information of software packages. This package is useful for validating license identifiers, checking if a license ID is deprecated, and listing all valid SPDX license IDs.
What are spdx-license-ids's main functionalities?
List of all SPDX license IDs
This feature provides an array of all non-deprecated SPDX license identifiers. You can use this list to validate or display available licenses.
const spdxLicenseIds = require('spdx-license-ids');
console.log(spdxLicenseIds);
List of deprecated SPDX license IDs
This feature provides an array of deprecated SPDX license identifiers. It is useful for checking if a license ID is no longer valid according to the SPDX specification.
const spdxLicenseIdsDeprecated = require('spdx-license-ids/deprecated');
console.log(spdxLicenseIdsDeprecated);
Other packages similar to spdx-license-ids
spdx
The 'spdx' package offers functions to parse, validate, and compare SPDX expressions. It provides more comprehensive functionality compared to spdx-license-ids, which only lists license IDs.
spdx-expression-parse
This package is used to parse and validate SPDX license expressions. Unlike spdx-license-ids, which provides lists of license IDs, spdx-expression-parse can handle complex license expressions, including those with 'AND' and 'OR' operators.
spdx-correct
The spdx-correct package is designed to correct invalid SPDX license IDs and expressions. It is more focused on error correction, while spdx-license-ids simply provides a list of valid and deprecated license IDs.
license-checker
While spdx-license-ids provides SPDX license identifiers, license-checker is a tool that scans a project's dependencies for license information, which can then be compared against the list of licenses provided by spdx-license-ids.
spdx-license-ids
![npm version](https://img.shields.io/npm/v/spdx-license-ids.svg)
A list of SPDX license identifiers
Installation
Download JSON directly, or use npm:
npm install spdx-license-ids
require('spdx-license-ids')
Type: string[]
All license IDs except for the currently deprecated ones.
const ids = require('spdx-license-ids');
ids.includes('BSD-3-Clause');
ids.includes('CC-BY-1.0');
ids.includes('GPL-3.0');
require('spdx-license-ids/deprecated')
Type: string[]
Deprecated license IDs.
const deprecatedIds = require('spdx-license-ids/deprecated');
deprecatedIds.includes('BSD-3-Clause');
deprecatedIds.includes('CC-BY-1.0');
deprecatedIds.includes('GPL-3.0');
License
Creative Commons Zero v1.0 Universal