TobyAndToby/generate-license-file
TobyAndToby/generate-license-file has 100 GitHub stars and 17 forks. Star changes are not measured yet. Last checked 2026-11-09 09:07 UTC. Last push 2026-11-09.
Generates a text file containing all of the licences for your production dependencies
Crecimiento de estrellas medido
- in 24h
- Recopilando historial
- in 7 days
- Recopilando historial
- in 15 days
- Recopilando historial
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalGenerate License File
A CLI and code library to generate a text file containing all of the licenses for your production third-party dependencies.
Installation and Usage (CLI)
npm install generate-license-file --save-dev
npx 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. The file must be named package.json. |
--output |
Absolute or relative path for the generated output file. |
--overwrite |
(optional) Allows the CLI to overwrite 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 crlf or lf. If no value is provided your system default will be used. |
--ci |
(optional) Stops the CLI from prompting the user for inputs and instead exits with a non-zero exit code. |
--no-spinner |
(optional) Disable the CLI spinner while the output file is being generated. |
--config |
(optional) Specify the path to a generate-license-file config file at a non-standard location. |
--version |
(optional) Print the installed generate-license-file version. |
If either the --input or --output are omitted the CLI will prompt you for their values.
For a full description of the CLI arguments and their usages please see the relevant docs page.
Installation and Usage (Library API)
npm install generate-license-file --save-dev
TypeScript
import { generateLicenseFile, getLicenseFileText, getProjectLicenses } from "generate-license-file";
// Generate the license file and write it to disk.
await generateLicenseFile("./package.json", "./third-party-licenses.txt");
// Generate the license file content and return it as a string.
const licenseFileText: string = await getLicenseFileText("./package.json");
// Get an array of objects each containing the details of an
// identified license and the dependencies it pertains to.
const licenses: ILicense[] = await getProjectLicenses("./package.json");
For a full description of the library API and example usages please see the relevant docs page.
Advanced Configuration
Advanced configuration of the generated output can be done using a configuration file. In addition to the basic CLI arguments, a configuration file allows you to specify appendices, exclusions, and replacements.
Config files can be called either .glf or .generatelicensefile and can be customised using the following options:
- File name can optionally end with
rc - Can be in a
./.configdirectory (no longer needs the.prefix on the file name) - Have the following file extensions:
.json,jsonc,.json5,.yaml,.yml,.js,.cjs
E.g. .glf.json, .glfrc.yml, .generatelicensefile.jsonc, .config/glf.js, and more.
{
// Default config - can be passed in via config and/or CLI
"inputs": ["./package.json"],
"output": "./third-party-licenses.txt",
"lineEnding": "lf",
// Paths to any file's whose content will be appended to the end of the generated file.
"append": ["./additional-content.txt"],
// Substitute the given packages license with the content in the respective file.
"replace": {
"[email protected]": "./bespoke-license.txt",
"another-replaced-package": "./bespoke-license-2.txt"
},
// Exclude any packages from the output.
"exclude": ["your-package", "[email protected]", "/.*prettier.*/i"],
// Omit the version number in the output file
"omitVersions": false
}
If you want to call your config file something else then you can pass it to the CLI via the --config argument:
npx generate-license-file --config ./my-config.json
Contributing and Building From Source
generate-license-file is a Bun + Turborepo monorepo. Common commands are aliased in the root package.json.
Each package under packages/ contains a README with further information. The main library and CLI is under packages/generate-license-file.
# cwd: repo root
bun install
bun run lint # Biome
bun run test # unit tests (Vitest)
bun run test:e2e # e2e tests
bun run build # builds all packages to packages/<name>/dist/
License
generate-license-file is licensed under the ISC License.
Explorar proyectos relacionados
codecrafters-io/build-your-own-x
Domina la programación recreando desde cero tus tecnologías favoritas.
561,279 estrellaspublic-apis/public-apis
Una lista colectiva de API gratuitas
497,539 estrellasmorluto/rea
Ingeniería inversa de cualquier cosa con agentes, desde el comportamiento de la aplicación hasta los binarios nativos.
446,086 estrellasopenclaw/openclaw
La IA que de verdad hace las cosas. Cualquier sistema operativo y cualquier plataforma. Al estilo langosta. 🦞
394,235 estrellas