Aalexbit-codemod

knip

Run knip to declutter your JavaScript & TypeScript projects

knipunuseddependencieslint
Public
4 executions
Run locally
npx codemod knip
Documentation

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

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.

Ready to contribute?

Build your own codemod and share it with the community.