spdx-license
v1.0.2
Published
Get SPDX license information
Downloads
218
Maintainers
Readme
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>;
}
- cross-fetch-json: Universal fetch API that only returns JSON
- @bconnorwhite/bob: Bob is a toolkit for TypeScript projects
- jest: Delightful JavaScript Testing.
Related Packages:
- npm-description: Fetch a package's description from NPM
- all-package-names: Get all NPM package names.
- is-name-taken: Check if an NPM package name is taken