Repolode
webpro-nl

webpro-nl/knip

Finds unused files, dependencies and exports in JavaScript and TypeScript projects so you can remove dead code before shipping.

Stars
12,616
Forks
546
Open issues
21
Last commit
yesterday

What is it?

Knip is a command-line tool that scans JavaScript and TypeScript projects for unused files, unused dependencies, and unused exports. Removing this dead code reduces bundle size, lowers maintenance work, and makes refactoring safer.

It is distributed as the npm package knip. Editor support is available through a VS Code extension, a language server package, and an MCP package for AI tooling.

The project is maintained by webpro-nl and released under the ISC license.

Key features

  • 01Detects unused files, dependencies and exports in JS and TS projects.
  • 02Provides a CLI for running checks locally or in CI.
  • 03Offers a VS Code extension for editor integration.
  • 04Ships a language server and an MCP package for tooling and AI assistants.

Use cases

  • Cleaning up dead code in a long-lived TypeScript monorepo before a release.
  • Finding unused npm dependencies that bloat installs and audits.
  • Enforcing no-dead-code checks in a CI pipeline.

Quick start

  1. 1

    Install Knip as a dev dependency with npm

    npm install -D knip
  2. 2

    Run Knip in your project root to find unused files, dependencies and exports

    npx knip

In collections

Topics

#javascript#typescript#linter#dead-code#dependency-analysis#unused-exports#static-analysis#deadcode#dependency-management#lint

FAQ

What is knip?
Finds unused files, dependencies and exports in JavaScript and TypeScript projects so you can remove dead code before shipping. Knip is a command-line tool that scans JavaScript and TypeScript projects for unused files, unused dependencies, and unused exports. Removing this dead code reduces bundle size, lowers maintenance work, and makes refactoring safer.
Is knip free to use? What license does it have?
knip is open source under the ISC license. Check the license terms before using it in commercial products.
Is knip still maintained?
Actively maintained. The last commit to knip was on Nov 5, 2026.
What can I use knip for?
Cleaning up dead code in a long-lived TypeScript monorepo before a release. Finding unused npm dependencies that bloat installs and audits. Enforcing no-dead-code checks in a CI pipeline.
How do I install knip?
Install Knip as a dev dependency with npm: npm install -D knip Run Knip in your project root to find unused files, dependencies and exports: npx knip
Where can I get knip?
The source code and installation instructions are on GitHub: https://github.com/webpro-nl/knip

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects