package
A library to list and retrieve open source license texts
npm install licenceGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
A TypeScript library to list and retrieve open-source license texts.
Import the library into your TypeScript or JavaScript project as follows:
import { listLicenses, getLicenseText } from 'licence';Use the listLicenses function to get an array of all supported licenses:
const licenses = listLicenses();
console.log(licenses);
// Output: ['MIT', 'Apache-2.0', 'GPL-3.0', ...]Use the getLicenseText function to fetch the full text of a specific license:
try {
const mitLicenseText = getLicenseText('MIT');
console.log(mitLicenseText);
} catch (error) {
console.error(error.message);
}The following open-source licenses are supported by this library:
MITApache-2.0GPL-3.0BSD-2-ClauseBSD-3-ClauseISCUnlicenseMPL-2.0LGPL-3.0AGPL-3.0Estimated unpacked size across 1 packages.
100.3 kB
Includes dependencies.