ntlp

npm tarball license parser and conformance checker

Usage no npm install needed!

<script type="module">
  import ntlp from 'https://cdn.skypack.dev/ntlp';
</script>

README

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