A modern dead-code analysis and usage graph engine for JavaScript/TypeScript.
npm install devoidDevoid is a fast static analyzer that detects:
- Unused exports
- Unused local identifiers (functions, variables, classes, types)
- Unused files
- Incorrect or unreachable re-exports
- Usage propagation through wildcards and barrel modules
- Import resolution via TS path aliases, directory imports, and relative paths
Devoid is powered the TypeScript Compiler API directly at runtime — no other dependencies.
---
``sh`
npm install -g devoidor
pnpm add -g devoidor
yarn global add devoid
`sh`
npm install -D devoidor
pnpm add -D devoidor
yarn add -D devoid
`sh`
devoid src/
`sh`
devoid src/ --exports
devoid src/ --files
devoid src/ --locals
devoid src/ --json
List exports that are never imported or referenced:
`sh`
devoid src/ --exports
List files that are unreachable from the entrypoints and have no side effects:
`sh`
devoid src/ --files
Detect unused classes, enums, functions, and variables within files:
`sh`
devoid src/ --localsor
devoid src/ --identifiers
Enable strict mode to include type declarations:
`sh`
devoid src/ --locals --track-all-locals
Detect unused exported types and local type declarations:
`sh`
devoid src/ --types
Types mode:
- Tracks type and interface usage only
- Respects import type and export type
- Follows barrel and wildcard type re-exports
- Does not require the TypeScript type checker
- Does not affect runtime export analysis
`sh`
devoid src/ --json
`sh`
devoid src/ --summary-only
Print raw graphs for debugging:
`sh`
devoid src/ --verbose
Analyze unused identifiers within a single file only:
`sh`
devoid internal src/utils/helpers.ts
Enable strict local tracking:
`sh`
devoid internal src/utils/helpers.ts --track-all-locals
Ignore files or directories containing a substring:
`sh`
devoid src/ --ignore dist --ignore generated
`sh``
devoid src/ --no-color
devoid src/ --color
MIT © Elijah Kotyluk