@nodesecure/licenses-conformance

Check spdx license expressions

Usage no npm install needed!

<script type="module">
  import nodesecureLicensesConformance from 'https://cdn.skypack.dev/@nodesecure/licenses-conformance';
</script>

README

NodeSecure Licenses conformance

version Maintenance Security Responsible Disclosure mit

NodeSecure licenses conformance.

Requirements

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

This repository is inspired by cutenode/conformance

$ npm i @nodesecure/licenses-conformance
# or
$ yarn add @nodesecure/licenses-conformance

Usage example

import conformance from "@nodesecure/licenses-conformance";

const mitLicense = licenseConformance("MIT");
/*  
  {
    uniqueLicenseIds: ["MIT"],
    spdxLicenseLinks: ["https://spdx.org/licenses/MIT.html#licenseText"],
    spdx: {
      osi: true,
      fsf: true,
      fsfAndOsi: true,
      includesDeprecated: false
    }
  }
*/

const errorLicense = licenseConformance("notalicense");
/*
should throw an Error like

Passed license expression was not a valid license expression. Error from spdx-expression-parse: Error: `u` at offset 0
*/

API

See TypeScript definition file.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

License

MIT This repository is inspired by cutenode/conformance