1.0.0 • Published 5 months ago
@alialhadiabokhalil/dep-cleaner v1.0.0
dep-cleaner
An intelligent command-line tool to identify and clean unused dependencies from Node.js projects.
Features
- Scans your entire codebase to identify all imported modules
- Analyzes which dependencies are actually used
- Identifies unused dependencies and those imported but not utilized
- Automatically removes unused dependencies from package.json and uninstalls them
- Integrates with AI to handle complex scenarios and provide intelligent suggestions
Installation
npm install -g dep-cleaner
Usage
Scan your project for unused dependencies
dep-cleaner scan
This will scan your project and display a report of used and unused dependencies without making any changes.
Clean unused dependencies
dep-cleaner clean
This will scan your project, identify unused dependencies, and automatically remove them after confirmation.
Generate a detailed report
dep-cleaner report
This will generate a detailed report of all dependencies, their usage status, and recommendations.
Configuration
You can configure dep-cleaner by creating a .depcleanerrc.json
file in your project root:
{
"ignore": ["dist", "build", "coverage"],
"alwaysKeep": ["react", "react-dom"],
"alwaysRemove": [],
"aiEnabled": true,
"aiConfidenceThreshold": 0.8
}
Precautions
- Always backup your project or use version control before removing dependencies
- Review AI suggestions, especially for critical dependencies
- Test your application thoroughly after cleaning to ensure functionality remains intact
License
MIT
1.0.0
5 months ago