Unused Dependencies Cleaner for VS Code
Remove dead npm dependencies faster. Unused Dependencies Cleaner scans your project, detects unused dependencies and devDependencies, and lets you remove them directly from the VS Code sidebar.
This extension is designed for JavaScript and TypeScript projects that want cleaner package.json files, smaller dependency surface, and easier maintenance.
Why Use Unused Dependencies Cleaner?
- Find unused npm packages in seconds.
- Reduce dependency bloat in
package.json.
- Clean up
dependencies and devDependencies safely with confirmation.
- Stay inside VS Code, no external CLI required.
Features
- Scans root
package.json.
- Checks both:
dependencies
devDependencies
- Recursively scans source files:
- Detects package usage from:
- ES module imports:
import ... from 'pkg'
- CommonJS imports:
require('pkg')
- Ignores:
- relative imports (
./, ../, /)
node_modules, dist, build
@types/* imports (default MVP behavior)
- Normalizes package names, including scoped packages.
- Shows grouped results in Output Channel:
Unused Dependencies Cleaner.
- Provides one-click removal from sidebar tree items with confirmation.
The extension adds a dedicated Activity Bar section:
Deps Cleaner
Unused Dependencies Cleaner view
Available actions:
- Refresh scan
- Open
package.json
- Remove selected unused dependency
How It Works
- Reads root
package.json.
- Builds the list of declared dependencies.
- Scans project imports to build the list of used packages.
- Compares declared vs used.
- Displays unused packages grouped by dependency type.
- On removal, updates and saves
package.json.
Quick Start
- Open a JavaScript/TypeScript project that contains a root
package.json.
- Open
Deps Cleaner in the Activity Bar.
- Click refresh in the view title.
- Review unused dependencies.
- Click a dependency to remove it, then confirm.
Notifications
You will see one of these messages after scanning:
No unused dependencies found
X unused dependencies found
Use Cases
- Before opening a pull request.
- Before publishing a package.
- During dependency audits.
- During refactoring or monolith cleanup.
Limitations (MVP)
- Scans only the root
package.json in the current workspace.
- Minimal monorepo handling (root only).
- Static import detection only (
import / require).
Keywords
unused dependencies, dependency cleaner, npm cleanup, package.json cleanup, VS Code extension, JavaScript tooling, TypeScript tooling, devDependencies cleanup, remove unused packages
Development
npm install
npm run compile
Press F5 to launch the Extension Development Host.
License
MIT