Skip to content
Check if the string is one of the SPDX license identifiers
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.travis.yml
LICENSE
README.md
bower.json
browser.js
index.js
package.json
test.js

README.md

is-spdx-license-id

NPM version Bower version Build Status Coverage Status Dependency Status devDependency Status

Check if the string is one of the SPDX license identifiers

isSpdxLicenseId('MIT'); //=> true
isSpdxLicenseId('zlib-acknowledgement'); //=> true

isSpdxLicenseId('foo-bar-baz'); //=> false

Installation

Package managers

npm

npm install is-spdx-license-id

Bower

bower install is-spdx-license-id

Duo

var isSpdxLicenseId = require('shinnn/is-spdx-license-id.js');

Standalone

Download the script file and its dependency.

API

isSpdxLicenseId(string)

string: String
Return: Boolean

It returns true when the argument is one of the SPDX license identifiers, such as 'MIT' and 'BSD-4-Clause'. Otherwise it returns false.

License

Copyright (c) 2014 - 2015 Shinnosuke Watanabe

Licensed under the MIT License.

Something went wrong with that request. Please try again.