A Rust linter with over 800 lints that catches common mistakes and suggests more idiomatic code, run as a cargo subcommand.
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
Install Knip as a dev dependency with npm
npm install -D knip - 2
Run Knip in your project root to find unused files, dependencies and exports
npx knip
In collections
Topics
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
Static code analysis tool for Kotlin projects that flags code smells and style issues, configurable via rule sets and a Gradle plugin.
A rule-based linter and auto-fixer for Chinese Markdown, built on an AST, with CLI, Prettier, ESLint and VS Code integrations and a programmatic API.
Codebase intelligence for developers and coding agents: call graph, git history, health scores, dead code and docs, served over MCP and a local dashboard.
Static analysis tool that finds unused functions, classes, variables, imports and unreachable code in Python projects.
A CSS linter that catches errors in stylesheets and enforces coding conventions, with over 100 built-in rules and auto-fix support.