ntlp
v1.1.3
Published
npm tarball license parser and conformance checker
Downloads
14
Maintainers
Readme
npm tarball license parser
license parser
Requirements
- Node.js v12 or higher
Getting Started
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i ntlp
# or
$ yarn add ntlp
Usage example
const parseLicense = require("ntlp");
async function main() {
const result = await parseLicense(__dirname);
console.log(license);
}
main().catch(console.error);
Return the following interface
interface license {
uniqueLicenseIds: string[];
spdxLicenseLinks: string[];
spdx: {
osi: boolean;
fsf: boolean;
fsfAndOsi: boolean;
includesDeprecated: boolean;
},
from: string;
}
interface result {
licenses: license[];
uniqueLicenseIds: Set<string>;
}
API
parseLicense(dest: string): Promise< ntlp.result >
parse a given tarball directory and return a result interface.
License
MIT