1.1.3 • Published 5 years ago

ntlp v1.1.3

Weekly downloads
70
License
MIT
Repository
github
Last release
5 years ago

npm tarball license parser

license parser

Requirements

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