ntlp
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

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

Package Sidebar

Install

npm i ntlp

Weekly Downloads

1

Version

1.1.3

License

MIT

Unpacked Size

7.27 kB

Total Files

6

Last publish

Collaborators

  • fraxken