{"_id":"@berenddeboer/nx-knip","_rev":"8-5e27062b73e41dd62fa0457d6878122d","name":"@berenddeboer/nx-knip","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"@berenddeboer/nx-knip","version":"0.1.0","keywords":["nx","knip","unused","dependencies","exports","dead code","monorepo","Node"],"author":{"name":"Berend de Boer"},"license":"MIT","_id":"@berenddeboer/nx-knip@0.1.0","maintainers":[{"name":"berenddeboer","email":"berend@pobox.com"}],"homepage":"https://github.com/berenddeboer/nx-plugins","bugs":{"url":"https://github.com/berenddeboer/nx-plugins/issues"},"dist":{"shasum":"6a6817c5308681452ec039699b2f11693492e9db","tarball":"https://registry.npmjs.org/@berenddeboer/nx-knip/-/nx-knip-0.1.0.tgz","fileCount":17,"integrity":"sha512-DNwHt4bUiG0sKh3uKj0F7/l0RlBgPTnf+Xi2nLd9wgx+Z98K3c44z+53ol7yVn1V2CoFF8mKIF85Hh/MqRpAgQ==","signatures":[{"sig":"MEUCIFj3YLK3JciNY9sCZnUhjllTwsOIuyAvg5AAtYfwvMFJAiEAplhxZfyblC97sn/1h198XVLntaZJnJkrWqADI0+Knlg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@berenddeboer%2fnx-knip@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":13197},"main":"src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"5ba09b1344bd781ad24df99c2b533ed7e8286ba9","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:16101e77-1403-4101-8a1c-9f22fbd785a4"}},"executors":"./executors.json","repository":{"url":"git+ssh://git@github.com/berenddeboer/nx-plugins.git","type":"git"},"_npmVersion":"11.7.0","description":"Nx self-inferring plugin for Knip - find unused dependencies, exports, and files","directories":{},"_nodeVersion":"24.12.0","dependencies":{"knip":"^5.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"@nx/devkit":"^20.6.4 || ^21.0.0 || ^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nx-knip_0.1.0_1766526223589_0.3142058626204314","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@berenddeboer/nx-knip","version":"0.1.1","keywords":["nx","knip","unused","dependencies","exports","dead code","monorepo","Node"],"author":{"name":"Berend de Boer"},"license":"MIT","_id":"@berenddeboer/nx-knip@0.1.1","maintainers":[{"name":"berenddeboer","email":"berend@pobox.com"}],"homepage":"https://github.com/berenddeboer/nx-plugins","bugs":{"url":"https://github.com/berenddeboer/nx-plugins/issues"},"dist":{"shasum":"c2374b5c20e1ddd1c3aea9f3dabc1870d7c55c6a","tarball":"https://registry.npmjs.org/@berenddeboer/nx-knip/-/nx-knip-0.1.1.tgz","fileCount":17,"integrity":"sha512-8XSvcFjlHlLVtGve3GEQu0qGLtIJvAhaBxc2UGglt+/mvZwMdvnEmT3cmMNq+7TZgTf0TIqqKj/P9/k2MYZAig==","signatures":[{"sig":"MEUCIHGYfVbsccoRLByn1fvH+4gnmrJkdF7bjo8PDywnWIl/AiEA8uYFZVPwkM3gmqLQFr0re0GBFC//sutXGRi9IHUdtcs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@berenddeboer%2fnx-knip@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":13366},"main":"src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"43379650134908ab97196fc50574be7c91375f5a","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:16101e77-1403-4101-8a1c-9f22fbd785a4"}},"executors":"./executors.json","repository":{"url":"git+ssh://git@github.com/berenddeboer/nx-plugins.git","type":"git"},"_npmVersion":"11.7.0","description":"Nx self-inferring plugin for Knip - find unused dependencies, exports, and files","directories":{},"_nodeVersion":"24.12.0","_hasShrinkwrap":false,"peerDependencies":{"knip":"^5.0.0","@nx/devkit":"^20.6.4 || ^21.0.0 || ^22.0.0"},"peerDependenciesMeta":{"knip":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/nx-knip_0.1.1_1766527654702_0.3405725332651104","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@berenddeboer/nx-knip","version":"1.0.0","keywords":["nx","knip","unused","dependencies","exports","dead code","monorepo","Node"],"author":{"name":"Berend de Boer"},"license":"MIT","_id":"@berenddeboer/nx-knip@1.0.0","maintainers":[{"name":"berenddeboer","email":"berend@pobox.com"}],"homepage":"https://github.com/berenddeboer/nx-plugins","bugs":{"url":"https://github.com/berenddeboer/nx-plugins/issues"},"dist":{"shasum":"5f56a0144ba2fae16e91cb46300c363a4a72063d","tarball":"https://registry.npmjs.org/@berenddeboer/nx-knip/-/nx-knip-1.0.0.tgz","fileCount":17,"integrity":"sha512-rRRalf4c9zS9za1BEa66z1v+sjIXAMurR/OPDsZEsRM0SF0vcof+OapzZnkAvhtP/9dOYJIRN9OI23qhGY9Mrw==","signatures":[{"sig":"MEYCIQCLtNWeonqq2aDG3AnBlApM6cSogukwWd6Sa5kLzRXQXwIhANhIo5xZ1b0B9oJq4kPXoJZ+36cuI1Cwa1lvmKpPlIfW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@berenddeboer%2fnx-knip@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15541},"main":"src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"4f3dd4cd28e9edf00b88a44f69c9fa6fea5d4b11","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:16101e77-1403-4101-8a1c-9f22fbd785a4"}},"executors":"./executors.json","repository":{"url":"git+ssh://git@github.com/berenddeboer/nx-plugins.git","type":"git"},"_npmVersion":"11.10.0","description":"Nx self-inferring plugin for Knip - find unused dependencies, exports, and files","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"peerDependencies":{"knip":"^5.0.0","@nx/devkit":"^20.6.4 || ^21.0.0 || ^22.0.0"},"peerDependenciesMeta":{"knip":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/nx-knip_1.0.0_1771286773838_0.9860534715475695","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@berenddeboer/nx-knip","version":"1.0.1","keywords":["nx","knip","unused","dependencies","exports","dead code","monorepo","Node"],"author":{"name":"Berend de Boer"},"license":"MIT","_id":"@berenddeboer/nx-knip@1.0.1","maintainers":[{"name":"berenddeboer","email":"berend@pobox.com"}],"homepage":"https://github.com/berenddeboer/nx-plugins","bugs":{"url":"https://github.com/berenddeboer/nx-plugins/issues"},"dist":{"shasum":"1e4fe1bca9e9a4943b5bc746ca82521e78ccdbda","tarball":"https://registry.npmjs.org/@berenddeboer/nx-knip/-/nx-knip-1.0.1.tgz","fileCount":17,"integrity":"sha512-ELTfE2zhHnG8vGYuF0jv9xMxGl7zCQAKmlOSHOCZnaf2N12vfv8KjqkTbnN5fjlCXyOPhFTAYcbjsLrm6tjYuw==","signatures":[{"sig":"MEUCIFEJQj0UXSJBwBBWQ8e2iqpymtE/jQN4T0C5gEs007oaAiEAn/74PiXTXQqO2MeHVioFxlxn9MSG1QV4sGNXbaD1cK0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@berenddeboer%2fnx-knip@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15743},"main":"src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"82590f2b599ac4d90b3227fb19ecc59d353a472f","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:16101e77-1403-4101-8a1c-9f22fbd785a4"}},"executors":"./executors.json","repository":{"url":"git+ssh://git@github.com/berenddeboer/nx-plugins.git","type":"git"},"_npmVersion":"11.10.0","description":"Nx self-inferring plugin for Knip - find unused dependencies, exports, and files","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"peerDependencies":{"knip":"^5.0.0","@nx/devkit":"^20.6.4 || ^21.0.0 || ^22.0.0"},"peerDependenciesMeta":{"knip":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/nx-knip_1.0.1_1771287923718_0.2661859884269524","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@berenddeboer/nx-knip","version":"1.0.2","keywords":["nx","knip","unused","dependencies","exports","dead code","monorepo","Node"],"author":{"name":"Berend de Boer"},"license":"MIT","_id":"@berenddeboer/nx-knip@1.0.2","maintainers":[{"name":"berenddeboer","email":"berend@pobox.com"}],"homepage":"https://github.com/berenddeboer/nx-plugins","bugs":{"url":"https://github.com/berenddeboer/nx-plugins/issues"},"dist":{"shasum":"3e66bdbbd2cf10f0c2e2939985f62fd8d470b29b","tarball":"https://registry.npmjs.org/@berenddeboer/nx-knip/-/nx-knip-1.0.2.tgz","fileCount":17,"integrity":"sha512-jMXtl/FNKcNKR8yzR8cnK/KHf2HiZjGFA1vhl8iYq/CQDVe9u4s7OX6TqP/Hqj4xZU6oCOHR6+2bxMmjQACtng==","signatures":[{"sig":"MEUCIDeqa/PH5dsvdcJobaq/ByR8a+mHEx0WIl/YxEh5wnr/AiEA8o4dse4v4+paTqlX5OOtOd+BRRI8PbQNlDSDMYT9ik8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@berenddeboer%2fnx-knip@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16536},"main":"src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"fec55d6e5644e08609a7137403d1dd9d3b8df5d4","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:16101e77-1403-4101-8a1c-9f22fbd785a4"}},"executors":"./executors.json","repository":{"url":"git+ssh://git@github.com/berenddeboer/nx-plugins.git","type":"git"},"_npmVersion":"11.10.0","description":"Nx self-inferring plugin for Knip - find unused dependencies, exports, and files","directories":{},"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"peerDependencies":{"knip":"^5.0.0","@nx/devkit":"^20.6.4 || ^21.0.0 || ^22.0.0"},"peerDependenciesMeta":{"knip":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/nx-knip_1.0.2_1771289770567_0.6279265251922546","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@berenddeboer/nx-knip","version":"1.1.0","main":"src/index.js","executors":"./executors.json","keywords":["nx","knip","unused","dependencies","exports","dead code","monorepo","Node"],"author":{"name":"Berend de Boer"},"repository":{"type":"git","url":"git+ssh://git@github.com/berenddeboer/nx-plugins.git"},"homepage":"https://github.com/berenddeboer/nx-plugins","description":"Nx self-inferring plugin for Knip - find unused dependencies, exports, and files","license":"MIT","peerDependencies":{"@nx/devkit":"^20.6.4 || ^21.0.0 || ^22.0.0","knip":"^5.0.0"},"peerDependenciesMeta":{"knip":{"optional":false}},"types":"./src/index.d.ts","type":"commonjs","gitHead":"d237ab9cc57364459b7e682b8fe627efb98c1d31","_id":"@berenddeboer/nx-knip@1.1.0","bugs":{"url":"https://github.com/berenddeboer/nx-plugins/issues"},"_nodeVersion":"24.13.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-rXnA8HwK2N6w2O/g6cNK3HCfePSbvJtmd/IEguna0FU4Lof7KUrrFO+oasQqZ7MTPS5Nt5Fu/pgtM6KlAV0tZg==","shasum":"320ced5d0b60697cb0595a90dd124d2b7c1c3449","tarball":"https://registry.npmjs.org/@berenddeboer/nx-knip/-/nx-knip-1.1.0.tgz","fileCount":20,"unpackedSize":22319,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@berenddeboer%2fnx-knip@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD2bvnvzyBpEO93Qx+eGuNckcw5WcXKiqyDStABZVxQ9wIhAM33JxSwSnvsnlgH6NZ7O84fSsGCKXJUldeRj4qWLSdr"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:16101e77-1403-4101-8a1c-9f22fbd785a4"}},"directories":{},"maintainers":[{"name":"berenddeboer","email":"berend@pobox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nx-knip_1.1.0_1772488334067_0.3197254225674304"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-23T21:40:06.535Z","modified":"2026-03-02T21:52:14.569Z","0.0.0":"2025-12-23T21:40:06.776Z","0.1.0":"2025-12-23T21:43:43.718Z","0.1.1":"2025-12-23T22:07:34.823Z","1.0.0":"2026-02-17T00:06:13.980Z","1.0.1":"2026-02-17T00:25:23.923Z","1.0.2":"2026-02-17T00:56:10.708Z","1.1.0":"2026-03-02T21:52:14.268Z"},"bugs":{"url":"https://github.com/berenddeboer/nx-plugins/issues"},"author":{"name":"Berend de Boer"},"license":"MIT","homepage":"https://github.com/berenddeboer/nx-plugins","keywords":["nx","knip","unused","dependencies","exports","dead code","monorepo","Node"],"repository":{"type":"git","url":"git+ssh://git@github.com/berenddeboer/nx-plugins.git"},"description":"Nx self-inferring plugin for Knip - find unused dependencies, exports, and files","maintainers":[{"name":"berenddeboer","email":"berend@pobox.com"}],"readme":"# @berenddeboer/nx-knip\n\nA self-inferring Nx plugin for [Knip](https://knip.dev/) - find unused dependencies, exports, and files in your JavaScript/TypeScript projects.\n\n## Install\n\nInstall both the plugin and knip:\n\n<details open>\n<summary>npm</summary>\n\n```sh\nnpm install --save-dev @berenddeboer/nx-knip knip\n```\n\n</details>\n\n<details>\n<summary>pnpm</summary>\n\n```sh\npnpm add --save-dev @berenddeboer/nx-knip knip\n```\n\n</details>\n\n<details>\n<summary>yarn</summary>\n\n```sh\nyarn add --dev @berenddeboer/nx-knip knip\n```\n\n</details>\n\n<details>\n<summary>bun</summary>\n\n```sh\nbun add -D @berenddeboer/nx-knip knip\n```\n\n</details>\n\n## Usage\n\n### Plugin Setup\n\nAdd the plugin to your `nx.json`:\n\n```json\n{\n  \"plugins\": [\n    {\n      \"plugin\": \"@berenddeboer/nx-knip\",\n      \"options\": {\n        \"targetName\": \"knip\"\n      }\n    }\n  ]\n}\n```\n\nThis will automatically add a `knip` target to all projects in your workspace.\n\n### Running Knip\n\nRun knip for a single project:\n\n```bash\nnx knip my-project\n```\n\nRun knip for all affected projects:\n\n```bash\nnx affected -t knip\n```\n\nOr run it for all projects:\n\n```bash\nnx run-many -t knip\n```\n\n## Executor Options\n\n### `strict`\n\nEnable [strict mode](https://knip.dev/features/production-mode#strict-mode) (implies `--production`). Defaults to `false`. When enabled, knip will:\n\n- Verify isolation: workspaces should use strictly their own dependencies\n- Include `peerDependencies` when finding unused or unlisted dependencies\n- Report type-only imports listed in `dependencies`\n\nYou can enable it for all projects via the plugin options in `nx.json`:\n\n```json\n{\n  \"plugins\": [\n    {\n      \"plugin\": \"@berenddeboer/nx-knip\",\n      \"options\": {\n        \"targetName\": \"knip\",\n        \"strict\": true\n      }\n    }\n  ]\n}\n```\n\nOr per-project in `project.json`:\n\n```json\n{\n  \"targets\": {\n    \"knip\": {\n      \"options\": {\n        \"strict\": true\n      }\n    }\n  }\n}\n```\n\n### `env`\n\nSet environment variables for the knip process. This is useful when knip loads `.ts` files that throw on missing environment variables - you can provide dummy values so knip can analyze the files without errors.\n\nConfigure via `targetDefaults` in `nx.json`:\n\n```json\n{\n  \"targetDefaults\": {\n    \"knip\": {\n      \"options\": {\n        \"env\": {\n          \"SQLITE_DATABASE_PATH\": \"/tmp/knip-dummy.db\",\n          \"PF_ORG\": \"examples/demo\"\n        }\n      }\n    }\n  }\n}\n```\n\nOr per-project in `project.json`:\n\n```json\n{\n  \"targets\": {\n    \"knip\": {\n      \"options\": {\n        \"env\": {\n          \"DATABASE_URL\": \"postgres://localhost/dummy\"\n        }\n      }\n    }\n  }\n}\n```\n\nThe provided environment variables are merged with the current `process.env`, so existing variables are preserved and the specified ones are added or overridden.\n\n## How it works\n\nThis plugin runs `knip --workspace {projectRoot}` from the workspace root for each project. This means:\n\n1. It uses the `--workspace` flag to focus on a specific workspace\n2. The workspace root `knip.json` configuration is used\n3. If [Bun](https://bun.sh) is installed, the plugin automatically uses `knip-bun` for significantly better performance\n\n## Learn More\n\n- [Knip Documentation](https://knip.dev/)\n- [Nx Plugins](https://nx.dev/concepts/nx-plugins)\n","readmeFilename":"README.md"}