# webpro-nl/knip

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/webpro-nl-knip).**

11,491 stars · 425 forks · TypeScript · ISC

## Links

- GitHub: https://github.com/webpro-nl/knip
- Homepage: https://knip.dev
- awesome-repositories: https://awesome-repositories.com/repository/webpro-nl-knip.md

## Topics

`deadcode` `dependency-analysis` `dependency-management` `javascript` `lint` `linter` `maintenance` `typescript` `unused-code` `unused-exports`

## Description

Knip is a static analysis project cleaner and dead code analyzer for JavaScript and TypeScript projects. It identifies and removes unused files, dependencies, and exports to maintain a lean codebase and reduce bundle size.

The tool functions as a monorepo dependency auditor, tracking exports and dependencies across multiple workspaces to find dead code in large multi-package projects. It specifically targets the removal of unused packages from project manifests and the deletion of unreferenced exports.

Its capabilities cover dead code elimination, JavaScript dependency management, and TypeScript project cleanup. This includes detecting transitive dependencies that are missing from the manifest and identifying orphaned modules or unused types.

## Tags

### Development Tools & Productivity

- [Dead Code Elimination](https://awesome-repositories.com/f/development-tools-productivity/dead-code-elimination.md) — Performs static analysis to identify and isolate unreferenced exports and dead code modules.
- [Dependency Analysis Tools](https://awesome-repositories.com/f/development-tools-productivity/dependency-analysis-tools.md) — Scans source code and build configurations to identify unused files, dependencies, and exports. ([source](https://knip.dev/reference/plugins))
- [Missing Dependency Detection](https://awesome-repositories.com/f/development-tools-productivity/dependency-analysis-tools/code-dependency-analysis/missing-dependency-detection.md) — Identifies packages used in the source code that are missing from the manifest to prevent transitive dependency reliance. ([source](https://knip.dev/typescript/unused-dependencies))
- [Unused Dependency Identification](https://awesome-repositories.com/f/development-tools-productivity/dependency-analysis-tools/code-dependency-analysis/unused-dependency-identification.md) — Analyzes code and configuration to find packages listed in the manifest that are not imported. ([source](https://knip.dev/typescript/unused-dependencies))
- [Dependency Bloat Reducers](https://awesome-repositories.com/f/development-tools-productivity/package-dependency-managers/dependency-bloat-reducers.md) — Finds and removes unused packages from project manifests to reduce bundle size and security risks.
- [Reverse Module Graphs](https://awesome-repositories.com/f/development-tools-productivity/package-managers/dependency/environment-aware-module-graphs/reverse-module-graphs.md) — Implements a reverse module graph to track whether specific exports are consumed by any other file.
- [Workspace Managers](https://awesome-repositories.com/f/development-tools-productivity/package-managers/dependency/workspace-managers.md) — Tracks dependencies and exports across multiple interconnected packages within a monorepo workspace. ([source](https://knip.dev/typescript/unused-dependencies))
- [Package Manifests](https://awesome-repositories.com/f/development-tools-productivity/package-manifests.md) — Analyzes package manifests to identify missing or unused dependencies by comparing them with actual imports.
- [Unused Package Identification](https://awesome-repositories.com/f/development-tools-productivity/package-removal-utilities/dependency-aware-removal/unused-package-identification.md) — Identifies and removes unused packages from package manifests by analyzing source code imports.
- [Dead Code Cleanup](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/project-scaffolding-configuration/project-configuration/project-cleanup-utilities/dead-code-cleanup.md) — Scans source code and configuration to locate orphaned modules and unused types.
- [Dependency Isolation Systems](https://awesome-repositories.com/f/development-tools-productivity/build-isolation-tools/dependency-isolation-systems.md) — Separates production and development dependencies to isolate dead code analysis across different environments. ([source](https://knip.dev/typescript/unused-dependencies))
- [Bundler Entry Points](https://awesome-repositories.com/f/development-tools-productivity/bundler-entry-points.md) — Uses framework-specific plugins to discover the entry point files that serve as roots for dependency analysis.
- [Automatic Export Removal](https://awesome-repositories.com/f/development-tools-productivity/dead-code-elimination/automatic-export-removal.md) — Automatically deletes unreferenced exports directly from the source code to remove project clutter. ([source](https://knip.dev/typescript/unused-exports))
- [Dependency Removers](https://awesome-repositories.com/f/development-tools-productivity/dependency-removers.md) — Automatically deletes unused packages from the project manifest to clean up the codebase. ([source](https://knip.dev/typescript/unused-dependencies))
- [Export Usage Tracers](https://awesome-repositories.com/f/development-tools-productivity/export-usage-tracers.md) — Tracks imports across files and workspaces to visualize the reverse module graph for specific exports. ([source](https://knip.dev/guides/troubleshooting))

### Programming Languages & Runtimes

- [Module Resolution](https://awesome-repositories.com/f/programming-languages-runtimes/language-ecosystems-tooling/module-management/module-resolution.md) — Resolves module imports across multiple internal packages by mapping relationships within monorepo workspaces.

### Software Engineering & Architecture

- [Monorepo Dependency Auditing](https://awesome-repositories.com/f/software-engineering-architecture/monorepo-dependency-auditing.md) — Tracks exports and dependencies across multiple workspaces to find dead code in large multi-package projects.
- [Syntax Tree Analysis](https://awesome-repositories.com/f/software-engineering-architecture/syntax-tree-analysis.md) — Parses source code into abstract syntax trees to identify import and export declarations for static analysis.
- [Transitive Dependency Detection](https://awesome-repositories.com/f/software-engineering-architecture/transitive-dependency-detection.md) — Identifies packages used in the code that are missing from the manifest to prevent runtime crashes.
- [Analysis Plugin Frameworks](https://awesome-repositories.com/f/software-engineering-architecture/analysis-plugin-frameworks.md) — Uses a plugin system to identify entry points and dependency patterns specific to various coding frameworks. ([source](https://knip.dev))

### Testing & Quality Assurance

- [Automated Code Cleaning](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/static-analysis/automated-code-cleaning.md) — Automatically deletes unreferenced exports and unused dependencies to maintain a lean codebase.
