{"id":19946089,"url":"https://github.com/quantco/pnpm-licenses","last_synced_at":"2025-05-03T16:32:51.032Z","repository":{"id":164435864,"uuid":"620994890","full_name":"Quantco/pnpm-licenses","owner":"Quantco","description":"Generate third party license disclaimers in pnpm-based projects","archived":false,"fork":false,"pushed_at":"2025-03-18T14:02:59.000Z","size":207,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-07T18:43:00.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quantco.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-03-29T19:29:43.000Z","updated_at":"2025-03-18T13:38:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"d57b2e4f-e768-431b-9f83-3000fbc735f1","html_url":"https://github.com/Quantco/pnpm-licenses","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpnpm-licenses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpnpm-licenses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpnpm-licenses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quantco%2Fpnpm-licenses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quantco","download_url":"https://codeload.github.com/Quantco/pnpm-licenses/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252216099,"owners_count":21713099,"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":[],"created_at":"2024-11-13T00:28:16.542Z","updated_at":"2025-05-03T16:32:50.677Z","avatar_url":"https://github.com/Quantco.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pnpm-licenses\n\n![npm](https://img.shields.io/npm/v/@quantco/pnpm-licenses?color=%23000000)\n\nThis is a CLI tool for generating lists of licenses for all dependencies of a project using [pnpm](https://pnpm.io).\n\n# Usage\n\nEither install `pnpm-licenses` globally or use `npx @quantco/pnpm-licenses` to run it.\n\n```\nusage: pnpm-licenses [command] [options]\n\ncommands:\n  list [options]                 List all dependencies and their licenses\n\n    --prod, -p                   Only consider production dependencies\n    --json-input                 Read input from stdin as json, instead of calling pnpm ourselves\n    --json-input-file, -i        Read input from a (json) file, instead of calling pnpm ourselves or reading from stdin\n    --output-file, -o            Output to a file instead of stdout\n    --filter=\"\u003cjson object\u003e\"     Filter out dependencies via glob patterns.\n                                 Example: --filter='[\"@quantco/*\", \"@pnpm/*\"]'\n                                          --filter='[\"**\", \"!@quantco/*\", \"!@pnpm/*\"]' (inverted match)\n\n    --help                       Get help for the list command\n\n\n  generate-disclaimer [options]  Generate a disclaimer for all dependencies\n\n    --prod, -p                   Only consider production dependencies\n    --json-input                 Read input from stdin as json, instead of calling pnpm ourselves\n    --json-input-file, -i        Read input from a (json) file, instead of calling pnpm ourselves or reading from stdin\n    --output-file, -o            Output to a file instead of stdout\n    --filter=\"\u003cjson object\u003e\"     Filter out dependencies via glob patterns.\n                                 Example: --filter='[\"@quantco/*\", \"@pnpm/*\"]'\n                                          --filter='[\"**\", \"!@quantco/*\", \"!@pnpm/*\"]' (inverted match)\n\n    --help                       Get help for the generate-disclaimer command\n\n  version                        Print the version number (also available as --version)\n  help                           Print this help message (also available as --help)\n```\n\n# Commands\n\nThere are two major commands available: `list` and `generate-disclaimer`\n\n## List command\n\nThis lists the dependencies of a project and their licenses (including text!).\n\nNote that the license texts are sometimes extracted or inferred using all kinds of metadata, there might not be a matching `LICENSE` file on disk.\n\nThis command can be used to implement your own disclaimer generation in case you want some slightly different behavior than `generate-disclaimer` gives you.\n\nUsing `--filter` (or `-f`) you can filter out dependencies via glob patterns. See [multimatch - Globbing patterns](https://github.com/sindresorhus/multimatch#globbing-patterns) for a description of the syntax.\nIf you'd like to invert the pattern use the following: `[\"**\", \"!@quantco/*\", \"!@pnpm/*\"]` (i.e. for a given list of patterns called `patterns` use `['**', ...patterns.map(p =\u003e '!' + p)]` formatted as JSON).\n\n### Examples\n\n```bash\nnpx @quantco/pnpm-licenses list --prod --output-file=output.json\nnpx @quantco/pnpm-licenses list --prod --output-file=output.json --filter='[\"@quantco/*\", \"@pnpm/*\"]'\npnpm licenses list --prod --json | npx @quantco/pnpm-licenses list --json-input\nnpx @quantco/pnpm-licenses list --json-input-file=dependencies.json\n```\n\n### Output\n\nYou'll receive a giant array of objects, each representing a dependency:\n\n```ts\ntype Dependency = {\n    name: string // from package.json\n    version: string // from package.json\n    path: string // file path to directory of dependency on disk\n    license: string // from package.json\n    author?: string | undefined // from package.json\n    homepage?: string | undefined // from package.json\n    description?: string | undefined // from package.json\n    additionalText?: string | undefined // set for dependencies with \"public domain like\" licences as a replacement for \"Copyright (c) \u003cauthor\u003e\"\n    licenseText: string | undefined // license text\n}\n```\n\n\u003e Note that if multiple versions of a package are installed the output will contain the same package multiple times with differing versions (and paths)\n\n### Options\n\n```\n--prod, -p                   Only consider production dependencies\n--json-input                 Read input from stdin as json, instead of calling pnpm ourselves\n--json-input-file, -i        Read input from a (json) file, instead of calling pnpm ourselves or reading from stdin\n--output-file, -o            Output to a file instead of stdout\n--filter, -f                 Filter out dependencies via glob patterns.\n```\n\n\n## Generate Disclaimer command\n\nThis is the main command that you'll probably want to use.\nIt generates a single large disclaimer for all third-party licenses you have in your pnpm project.\n\nUsing `--filter` (or `-f`) you can filter out dependencies via glob patterns. See [multimatch - Globbing patterns](https://github.com/sindresorhus/multimatch#globbing-patterns) for a description of the syntax.\nIf you'd like to invert the pattern use the following: `[\"**\", \"!@quantco/*\", \"!@pnpm/*\"]` (i.e. for a given list of patterns called `patterns` use `['**', ...patterns.map(p =\u003e '!' + p)]` formatted as JSON).\n\nThe file will look as follows:\n\n```\nTHE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THIS PRODUCT\n\nThe following software may be included in this product: \u003cpackage name\u003e (\u003cpackage version\u003e)\nThis software contains the following license and notice below:\n\nMIT License\n\nCopyright (c) \u003cauthor\u003e\n\n\u003cactual license text\u003e\n\n---\n\nThe following software may be included in this product: \u003cpackage name\u003e (\u003cpackage version\u003e)\nThis software contains the following license and notice below:\n\n...\n```\n\n### Examples\n\n```bash\npnpm licenses list --json --prod | npx @quantco/pnpm-licenses generate-disclaimer --json-input --output-file=third-party-licenses.txt\nnpx @quantco/pnpm-licenses generate-disclaimer --prod --output-file=third-party-licenses.txt\nnpx @quantco/pnpm-licenses generate-disclaimer --prod --filter='[\"@quantco/*\", \"@pnpm/*\"]'\n```\n\n### Options\n\n```\n--prod, -p                   Only consider production dependencies\n--json-input                 Read input from stdin as json, instead of calling pnpm ourselves\n--json-input-file, -i        Read input from a (json) file, instead of calling pnpm ourselves or reading from stdin\n--output-file, -o            Output to a file instead of stdout\n--filter, -f                 Filter out dependencies via glob patterns.\n```\n\n\n# API\n\nYou can also use this as part of your own library using the programmatic api.\n\n```ts\nimport {\n  generateDisclaimer,\n  getDependencies,\n  getLicenseText,\n  resolveLicensesBestEffort\n} from '@quantco/pnpm-licenses/dist/api'\nimport type { PnpmDependency, PnpmDependencyResolvedLicenseText } from '@quantco/pnpm-licenses/dist/api'\n```\n\nHave a look at the type definitions for more details.\n\n# Bugs and feature requests\n\nThis package is in the very early stages of development.\nIf you find any bugs or have any feature requests, please open an issue on [GitHub](https://github.com/Quantco/pnpm-licenses/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantco%2Fpnpm-licenses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantco%2Fpnpm-licenses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantco%2Fpnpm-licenses/lists"}