{"id":13903015,"url":"https://github.com/TobyAndToby/generate-license-file","last_synced_at":"2025-07-18T00:32:55.173Z","repository":{"id":37023842,"uuid":"253930217","full_name":"TobyAndToby/generate-license-file","owner":"TobyAndToby","description":"Generates a text file containing all of the licences for your production dependencies","archived":false,"fork":false,"pushed_at":"2024-11-22T08:12:24.000Z","size":9715,"stargazers_count":70,"open_issues_count":9,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-22T09:19:43.390Z","etag":null,"topics":["cli","generator","licence","license","nodejs","npm","oss","third-party","third-party-libraries","third-party-licenses","typescipt"],"latest_commit_sha":null,"homepage":"https://generate-license-file.js.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TobyAndToby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-07T22:52:21.000Z","updated_at":"2024-11-22T08:11:34.000Z","dependencies_parsed_at":"2023-11-10T11:25:09.243Z","dependency_job_id":"2b0ac3e8-2e37-4903-8ef2-f150e10b2231","html_url":"https://github.com/TobyAndToby/generate-license-file","commit_stats":{"total_commits":358,"total_committers":6,"mean_commits":"59.666666666666664","dds":0.5223463687150838,"last_synced_commit":"0eb6701e75364898f6c2aa9bbf6d08f54acd7712"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TobyAndToby%2Fgenerate-license-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TobyAndToby%2Fgenerate-license-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TobyAndToby%2Fgenerate-license-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TobyAndToby%2Fgenerate-license-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TobyAndToby","download_url":"https://codeload.github.com/TobyAndToby/generate-license-file/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226320855,"owners_count":17606367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","generator","licence","license","nodejs","npm","oss","third-party","third-party-libraries","third-party-licenses","typescipt"],"created_at":"2024-08-06T22:01:33.720Z","updated_at":"2025-07-18T00:32:55.155Z","avatar_url":"https://github.com/TobyAndToby.png","language":"TypeScript","funding_links":[],"categories":["cli"],"sub_categories":[],"readme":"# Generate License File\n\nA CLI and code library to generate a text file containing all of the licenses for your production third-party dependencies.\n\n\u003ca href=\"https://www.npmjs.com/package/generate-license-file\"\u003e\n  \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/generate-license-file?logo=npm\"\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://codecov.io/github/TobyAndToby/generate-license-file\"\u003e\n  \u003cimg src=\"https://codecov.io/github/TobyAndToby/generate-license-file/branch/main/graph/badge.svg\"/\u003e\n\u003c/a\u003e\n\n## Installation and Usage (CLI)\n\n```bash\nnpm install generate-license-file --save-dev\n\nnpx generate-license-file --input package.json --output third-party-licenses.txt --overwrite\n```\n\n| Argument       | Description                                                                                                                                                       |\n| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `--input`      | Absolute or relative path to the package.json for the project.                                                                                                    |\n| `--output`     | Absolute or relative path for the generated output file.                                                                                                          |\n| `--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. |\n| `--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.        |\n| `--ci`         | (optional) Stops the CLI from prompting the user for inputs and instead exits with a non-zero exit code.                                                          |\n| `--no-spinner` | (optional) Disable the CLI spinner while the output file is being generated.                                                                                      |\n| `--config`     | (optional) Specify the path to a generate-license-file config file at a non-standard location.                                                                    |\n| `--version`    | (optional) Print the installed generate-license-file version.                                                                                                     |\n\nIf either the `--input` or `--output` are omitted the CLI will prompt you for their values.\n\nFor a full description of the CLI arguments and their usages please see the relevant [docs page](https://generate-license-file.js.org/docs/intro).\n\n## Installation and Usage (Library API)\n\n```bash\nnpm install generate-license-file --save-dev\n```\n\n#### TypeScript\n\n```ts\nimport { generateLicenseFile, getLicenseFileText, getProjectLicenses } from \"generate-license-file\";\n\n// Generate the license file and write it to disk.\nawait generateLicenseFile(\"./package.json\", \"./third-party-licenses.txt\");\n\n// Generate the license file content and return it as a string.\nconst licenseFileText: string = await getLicenseFileText(\"./package.json\");\n\n// Get an array of objects each containing the details of an\n// identified license and the dependencies it pertains to.\nconst licenses: ILicense[] = await getProjectLicenses(\"./package.json\");\n```\n\nFor a full description of the library API and example usages please see the relevant [docs page](https://generate-license-file.js.org/docs/library).\n\n## Advanced Configuration\n\nAdvanced 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.\n\nConfig files can be called either `.glf` or `.generatelicensefile` and can be customised using the following options:\n\n- File name can optionally end with `rc`\n- Can be in a `./.config` directory (no longer needs the `.` prefix on the file name)\n- Have the following file extensions: `.json`, `jsonc`, `.json5`, `.yaml`, `.yml`, `.js`, `.cjs`\n\nE.g. `.glf.json`, `.glfrc.yml`, `.generatelicensefile.jsonc`, `.config/glf.js`, and more.\n\n```jsonc\n{\n  // Default config - can be passed in via config and/or CLI\n  \"inputs\": [\"./package.json\"],\n  \"output\": \"./third-party-licenses.txt\",\n  \"lineEnding\": \"lf\",\n\n  // Paths to any file's whose content will be appended to the end of the generated file.\n  \"append\": [\"./additional-content.txt\"],\n\n  // Substitute the given packages license with the content in the respective file.\n  \"replace\": {\n    \"replaced-package@4.33.1\": \"./bespoke-license.txt\",\n    \"another-replaced-package\": \"./bespoke-license-2.txt\"\n  },\n\n  // Exclude any packages from the output.\n  \"exclude\": [\"my-package@1.2.0\"],\n  \n  // Omit the version number in the output file\n  \"omitVersion\": false\n}\n```\n\nIf you want to call your config file something else then you can pass it to the CLI via the `--config` argument:\n\n```bash\nnpx generate-license-file --config ./my-config.json\n```\n\n# Contributing and Building From Source\n\ngenerate-license-file is an NX Monorepo. We have aliased common commands in the scripts section of the `src/package.json` to make working with the project easier.\n\nEach package in the monorepo (under `src/packages/`) contains a README with further information. The main library and CLI is under `packages/generate-license-file`.\n\n```bash\n# cwd: src/\n\nnpm install\n\nnpm run lint\n\nnpm run test  # unit tests\n\nnpm run test:e2e  # e2e tests\n\nnpm run build  # will build all packages into src/dist/[package name]\n```\n\n# License\n\ngenerate-license-file is licensed under the [ISC License](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTobyAndToby%2Fgenerate-license-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTobyAndToby%2Fgenerate-license-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTobyAndToby%2Fgenerate-license-file/lists"}