Getting Started
Requirements
Knip v5 requires Node.js v18.6 or higher. Or Bun.
Looking for docs of previous versions? Go to v3.knip.dev or v4.knip.dev.
Installation
This is the easiest and recommended way to install Knip:
Now you can run Knip to lint your project:
Knip will lint your project and report unused files, dependencies and exports.
You can skip the rest of this page and go to configuration.
Manual
Alternatively, you can manually install Knip using your package manager:
Knip uses typescript
and @types/node
as peer dependencies to increase
compatibility with your project. No worries, they’re probably in your
node_modules
already.
Then add a knip
script to your package.json
:
Without installation
To run Knip without adding it to your project:
In this scenario typescript
and @types/node
are expected to be installed
already.
ISC License © 2024 Lars Kappert