get-spdx-license-ids
A Node.js module to get an array of the latest SPDX license identifiers from spdx.org
const getSpdxLicenseIds = ; async { const ids = await ; //=> ['0BSD', 'AAL', 'Abstyles', 'Adobe-2006', 'Adobe-Glyph', 'ADSL', 'AFL-1.1', 'AFL-1.2', ...]};
Installation
npm install get-spdx-license-ids
API
const getSpdxLicenseIds = ;
getSpdxLicenseIds([options])
options: Object
(request
options without json
option that defaults to true
)
Return: Promise<Array<string>>
It retrieves an array of non-deprecated SPDX license identifiers from https://spdx.org/licenses/licenses.json.
async { const ids = await ; ids; //=> true ids; //=> true ids; //=> false}
getSpdxLicenseIds.deprecated([options])
Retrieves deprecated IDs only.
async { const deprecatedIds = await getSpdxLicenseIds; deprecatedIds; //=> false deprecatedIds; //=> false deprecatedIds; //=> true};
getSpdxLicenseIds.all([options])
Retrieves both deprecated and non-deprecated IDs in a single array.
async { const allIds = await getSpdxLicenseIdsall; allIds; //=> true allIds; //=> true allIds; //=> false};
getSpdxLicenseIds.both([options])
Retrieves both deprecated and non-deprecated IDs in two separate arrays.
async { const pair = await getSpdxLicenseIds; pairlength; //=> 2 const valid deprecated = pair; valid; //=> true valid; //=> true valid; //=> false deprecated; //=> false deprecated; //=> false deprecated; //=> true};
License
ISC License © 2018 Shinnosuke Watanabe