Package detail

spdx-license

bconnorwhite111MIT1.0.2

Get SPDX license information

typed, license, get, spdx

readme

spdx-license

npm typescript GitHub stars Twitter Follow


Get SPDX license information.

Uses cross-fetch-json to support usage in both brower and node.

Installation

yarn add spdx-license
npm install spdx-license


API

Types

import { getLicense, getLicenses, FullLicense, Licenses, License } from "spdx-license";

function getLicense(id: string): Promise<FullLicense | undefined>;

function getLicenses(): Promise<Licenses>;

type FullLicense = {
  id: string;
  name: string;
  url: string;
  isDeprecated: boolean;
  isOSIApproved: boolean;
  isFSFLibre?: boolean;
  text: string;
};

type Licenses = {
  [id: string]: License;
}

type License = {
  id: string;
  name: string;
  url: string;
  isDeprecated: boolean;
  isOSIApproved: boolean;
  isFSFLibre?: boolean;
  getText: () => Promise<string | undefined>;
}


Dependenciesdependencies

#


Dev DependenciesDavid

#


License license

MIT


Related Packages: