generate-license-file

Generates a text file containing all of the licences for your production dependencies

Usage no npm install needed!

<script type="module">
  import generateLicenseFile from 'https://cdn.skypack.dev/generate-license-file';
</script>

README

Generate License File

A CLI and code library to generate a text file containing all the licenses for your production third-party dependencies.

npm

Installation and Usage (CLI)

$ npm install generate-license-file -g

$ generate-license-file --input package.json --output third-party-licenses.txt --overwrite
Argument Description
--input Absolute or relative path to the package.json for the project.
--output Absolute or relative location for the output licenses file.
--overwrite (optional) Allow the overwriting of existing output files.
If this option is not provided and the output file already exists, you will be prompted to confirm.
--eol (optional) Specify the line endings used in the output file.
Accepted values are windows or posix.
If no value is provided your system default will be used.
--no-spinner (optional) Disable the CLI spinner while the output file is being generated.

If either the --input or --output are omitted the CLI will prompt you for their values.

Installation and Usage (programmatic use)

$ npm install generate-license-file

TypeScript

import { getProjectLicenses } from "generate-license-file";

// Get an array of licenses for the current project's production dependencies.
const licenses: ILicense[] = await getProjectLicenses("./package.json");

JavaScript

const generateLicenseFile = require("generate-license-file");

// Get an array of licenses for the current project's production dependencies.
generateLicenseFile
  .getProjectLicenses("./package.json")
  .then(licenses => {
    // Do stuff with licenses...
  })
  .catch(error => {
    // Do stuff with error...
  });

License

generate-license-file is licensed under the ISC License.