bloatbuster
v1.0.2
Published
A viral CLI tool to identify and visualize bloated Node.js dependencies
Downloads
288
Maintainers
Readme
👻🚫 BloatBuster
Find and remove unused dependencies from your Node.js projects. BloatBuster scans your project, identifies bloat, and provides a beautiful dashboard to help you clean up your package.json.
Quick Start
Install
npm install -g bloatbusterOr use it without installing:
npx bloatbusterUse
Navigate to your project directory and run:
cd /path/to/your-project
bloatbusterThe dashboard will open automatically in your browser! 🎉
What BloatBuster Does
BloatBuster analyzes your Node.js project and:
- 🔍 Finds unused dependencies - Detects packages that aren't actually used in your code
- 📦 Shows package sizes - See how much space each dependency takes (including transitive dependencies)
- 🧬 Explains dependencies - Understand why each package is installed and what depends on it
- 💡 Suggests alternatives - Get recommendations for lighter alternatives to heavy packages
- ✂️ Optimizes imports - Get hints on how to improve tree-shaking and reduce bundle size
- 🧨 Safe removal - Remove unused packages with automatic rollback if something breaks
Usage
Basic Scan
bloatbusterScans your current directory and opens the dashboard.
Include Dev Dependencies
bloatbuster --include-devAlso analyzes packages in devDependencies.
Custom Port
bloatbuster --port 4000Use a specific port for the dashboard (default is random 3000+).
Combine Options
npx bloatbuster --include-dev --port 4000Dashboard Features
When you run BloatBuster, a web dashboard opens showing:
For Each Dependency
- Status Badge -
UNUSED,LARGE, orOPTIMAL - Size Information - Self size and total size (including all transitive dependencies)
- Dependency Chain - See which packages require this one
- Unused Explanations - If unused, understand why (e.g., only used in scripts, installed transitively, etc.)
- Impact Level -
low,medium, orhighbased on size - Lighter Alternatives - Suggestions for smaller replacement packages when available
- Import Optimization - Hints on how to improve tree-shaking (e.g., use
lodash/mapinstead ofimport _ from 'lodash') - File References - See exactly where the package is used in your code
Actions
- Remove - Remove a single unused dependency
- Remove All Unused - Bulk remove all unused packages
- Safe Purge - Remove with automatic validation and rollback (runs your tests/build to ensure nothing breaks)
How It Works
- Scans your project - Reads
package.jsonand analyzes your codebase - Detects unused packages - Uses advanced analysis to find packages that aren't imported or used
- Builds dependency tree - Maps out which packages depend on which
- Calculates sizes - Measures disk space used by each package
- Opens dashboard - Launches a local web server with interactive visualization
Safe Removal
BloatBuster's Safe Purge feature:
- Removes the dependency
- Re-scans your project
- Runs your tests (if you have a
testscript) or build (if you have abuildscript) - Automatically rolls back if validation fails
- Reports how much space you saved
This ensures you can safely remove dependencies without breaking your project.
Examples
Find unused packages
cd my-project
bloatbusterAnalyze everything including dev dependencies
bloatbuster --include-devUse a specific port
bloatbuster --port 8080Troubleshooting
"Web build not found" error
If you see this error, try:
npm uninstall -g bloatbuster
npm install -g bloatbusterThis will reinstall BloatBuster with the pre-built web dashboard.
Dashboard doesn't open
The dashboard runs on http://localhost:[port]. Check the terminal output for the exact URL and open it manually in your browser.
Port already in use
Use the --port option to specify a different port:
bloatbuster --port 4000Requirements
- Node.js 14+
- npm, yarn, or pnpm
- A Node.js project with a
package.jsonfile
License
MIT
