Package Exports
- spdx-license
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 (spdx-license) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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>;
}
Dependencies
- cross-fetch-json: Universal fetch API that only returns JSON
Dev Dependencies
- @bconnorwhite/bob: Bob is a toolkit for TypeScript projects
- jest: Delightful JavaScript Testing.
License 
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