mynameistechno / get-spdx-license-ids

Get an array of the list of SPDX license IDs from spdx.org

Home Page:https://spdx.org/licenses/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get-spdx-license-ids

NPM version Build Status Coverage Status Dependency Status devDependency Status

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', ...]
});

Installation

Use npm.

npm install get-spdx-license-ids

API

const getSpdxLicenseIds = require('get-spdx-license-ids');

getSpdxLicenseIds([options])

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
});

License

Copyright (c) 2016 Shinnosuke Watanabe

Licensed under the MIT License.

About

Get an array of the list of SPDX license IDs from spdx.org

https://spdx.org/licenses/

License:MIT License


Languages

Language:JavaScript 100.0%