0.0.0 • Published 8 years ago

tz-list v0.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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.