Socket
Socket
Sign inDemoInstall

@nodesecure/licenses-conformance

Package Overview
Dependencies
4
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nodesecure/licenses-conformance

Check spdx license expressions


Version published
Maintainers
5
Created

Readme

Source

SPDX Licenses conformance

version Maintenance OpenSSF
Scorecard mit build

NodeSecure SPDX licenses conformance. Project forked/inspired from cutenode/conformance.

Requirements

  • Node.js v18 or higher

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

Keywords

FAQs

Last updated on 28 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc