Caution
This project has been migrated to scanner monorepo
NodeSecure SPDX licenses conformance. Project forked/inspired from cutenode/conformance.
- Node.js v20 or higher
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
import { licenseIdConformance } from "@nodesecure/licenses-conformance";
const conformance = licenseIdConformance("MIT").unwrap();
console.log(conformance);
/*
{
uniqueLicenseIds: ["MIT"],
spdxLicenseLinks: ["https://spdx.org/licenses/MIT.html#licenseText"],
spdx: {
osi: true,
fsf: true,
fsfAndOsi: true,
includesDeprecated: false
}
}
*/
export interface SpdxLicenseConformance {
licenses: Record<string, string>
spdx: {
osi: boolean;
fsf: boolean;
fsfAndOsi: boolean;
includesDeprecated: boolean;
};
}
function licenseIdConformance(
licenseID: string
): Result<SpdxLicenseConformance, Error>;
function searchSpdxLicenseId(contentStr: string): string | null;
To update the src/data/spdx.ts
file just run the following npm script:
$ npm run spdx:refresh
It will fetch SPDX licenses here.
Thanks goes to these wonderful people (emoji key):
Vincent Dhennin 💻 🐛 📖 |
Gentilhomme 💻 👀 🛡️ |
Kouadio Fabrice Nguessan 🚧 |
MIT