knip: Declutter your JavaScript & TypeScript projects
This package wraps Knip so you can run it from the Codemod platform—especially Campaigns, which help you centrally orchestrate cleanup across many repositories and teams in one place.
Knip finds unused dependencies, exports, and files in JavaScript and TypeScript projects. This codemod does not replace Knip; it orchestrates the Knip CLI in a workflow-friendly way.
Credits
- Knip is created and maintained by Lars Kappert and contributors. Project: github.com/webpro-nl/knip · Documentation: knip.dev.
Why a wrapper?
Codemod workflows run shell steps with the target repository as the working directory. The runner script is embedded in workflow.yaml (base64) so Knip can execute reliably without requiring a global install or a fixed path to this package on every machine. When the embedded runner cannot use a local node_modules/knip, it invokes npx knip@latest.
Campaigns use that same workflow definition across repos, so teams get a consistent Knip invocation while Codemod handles scheduling, tracking, and rollout.
License
MIT (this codemod package). Knip is free and open-source software licensed under the ISC License.