JSPM

@nodesecure/licenses-conformance

2.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 809
  • Score
    100M100P100Q120132F
  • License MIT

Check spdx license expressions

Package Exports

  • @nodesecure/licenses-conformance
  • @nodesecure/licenses-conformance/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nodesecure/licenses-conformance) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

SPDX Licenses conformance

version Maintenance OpenSSF
Scorecard mit build

NodeSecure SPDX licenses conformance. Project forked/inspired from cutenode/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 { licenseIdConformance } from "@nodesecure/licenses-conformance";

const result = licenseIdConformance("MIT");
if (result.ok) {
  console.log(result.value);
}
/*  
  {
    uniqueLicenseIds: ["MIT"],
    spdxLicenseLinks: ["https://spdx.org/licenses/MIT.html#licenseText"],
    spdx: {
      osi: true,
      fsf: true,
      fsfAndOsi: true,
      includesDeprecated: false
    }
  }
*/

API

interface spdxLicenseConformance {
  uniqueLicenseIds: string[];
  spdxLicenseLinks: string[];
  spdx?: {
    osi: boolean;
    fsf: boolean;
    fsfAndOsi: boolean;
    includesDeprecated: boolean;
  };
}

function licenseIdConformance(
  licenseID: string
): { ok: true, value: spdxLicenseConformance } | { ok: false, value: Error };

function searchSpdxLicenseId(contentStr: string): string | null;

Updating SPDX licenses

To update the src/spdx.json file just run the following npm script:

$ npm run spdx:refresh

It will fetch SPDX licenses here.

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):

Vincent Dhennin
Vincent Dhennin

💻 🐛 📖
Gentilhomme
Gentilhomme

💻 👀 🛡️
Kouadio Fabrice Nguessan
Kouadio Fabrice Nguessan

🚧

License

MIT