A Node module to get an array of the latest SPDX license identifiers from spdx.org
const getSpdxLicenseIds = require('get-spdx-license-ids');
getSpdxLicenseIds().then(ids => {
ids; //=> ['Glide', 'Abstyles', 'AFL-1.1', 'AFL-1.2', 'AFL-2.0', 'AFL-2.1', ...]
});
npm install get-spdx-license-ids
const getSpdxLicenseIds = require('get-spdx-license-ids');
options: Object
(request
options without json
option that defaults to true
)
Return: Promise
instance
It gets an array of valid SPDX license identifiers from https://spdx.org/licenses/licenses.json and returns a promise.
const getSpdxLicenseIds = require('get-spdx-license-ids');
getSpdxLicenseIds().then(ids => {
ids.includes('MIT'); //=> true
ids.includes('zlib-acknowledgement'); //=> true
ids.includes('foo-bar-baz'); //=> false
});
Copyright (c) 2016 Shinnosuke Watanabe
Licensed under the MIT License.