dev-storage-clean
v2.0.0
Published
A powerful CLI tool to reclaim gigabytes of storage by cleaning unused node_modules, build folders, cache, and duplicate files
Maintainers
Readme
DevClean
A CLI tool to clean unused node_modules, build folders, cache, and duplicate files — and reclaim gigabytes of storage in seconds.
What It Does
- Finds unused
node_modulesfolders older than 3 months - Removes build artifacts like
dist,build,.next - Clears npm, yarn, and pnpm cache
- Detects and removes duplicate files
- Organizes your Downloads folder by file type
- Shows how much space you can recover
Installation
npm install -g dev-storage-cleanUsage
Interactive Mode
Run without any arguments to open the menu:
devclean? What would you like to do?
❯ 🔍 Scan System
🧹 Clean Junk Files
🗑️ Clear Cache
🔎 Find Duplicates
📁 Organize Downloads
📊 View Statistics
❌ ExitUse arrow keys to navigate, Enter to select.
Commands
devclean scan
Scan your system and show what can be cleaned.
devclean scanOutput:
┌───────────────────┬───────┬──────────┬────────────┐
│ Category │ Items │ Size │ Status │
├───────────────────┼───────┼──────────┼────────────┤
│ 📦 node_modules │ 15 │ 3.40 GB │ 5 old │
│ 🏗️ Build Folders │ 6 │ 1.41 GB │ Can clean │
└───────────────────┴───────┴──────────┴────────────┘
Total Recoverable: 4.81 GBOptions:
devclean scan --depth 5 # Scan deeper (default: 3)devclean clean
Delete unused files. Always shows a preview and asks for confirmation before deleting anything.
# Preview only — nothing gets deleted
devclean clean --dry-run
# Actually clean (asks for confirmation)
devclean cleanWhat gets deleted:
node_modulesfolders not touched in 3+ months- Build folders:
dist,build,.next,.nuxt,out - Log files:
.log - Temp files:
.tmp,.cache
devclean cache
Clear package manager cache.
devclean cacheSupports npm, yarn, and pnpm. You will be asked to choose which ones to clear.
devclean duplicates
Find duplicate files using SHA-256 hashing and remove extras.
# Scan home directory
devclean duplicates
# Scan a specific folder
devclean duplicates --path ~/DownloadsHow it works:
- Reads every file in the folder
- Generates a hash for each file
- Groups files with the same hash
- Shows you the duplicates and asks what to delete
devclean organize
Sort files in your Downloads folder into subfolders by type.
devclean organizeFiles are moved into:
| Folder | Extensions |
|--------|------------|
| Images | .jpg .png .gif .svg .webp |
| Videos | .mp4 .avi .mov .mkv |
| Documents | .pdf .doc .docx .xlsx .pptx |
| Archives | .zip .rar .7z .tar .gz |
| Audio | .mp3 .wav .flac .aac |
| Code | .js .ts .py .html .css |
| Executables | .exe .dmg .deb .pkg |
| Others | Everything else |
devclean stats
Show how much you have cleaned over time.
devclean stats┌─────────────────┬─────────────────────┐
│ Metric │ Value │
├─────────────────┼─────────────────────┤
│ 🔍 Total Scans │ 12 │
│ 🧹 Total Cleans │ 5 │
│ 💾 Space Freed │ 23.4 GB │
│ 📅 Last Scan │ 2025-01-15 10:30 AM │
│ 🗑️ Last Clean │ 2025-01-14 02:22 PM │
└─────────────────┴─────────────────────┘Safety
DevClean never deletes without asking.
- Dry run mode — preview before any action
- Confirmation prompt — always asks yes/no before deleting
- File preview — shows exactly which files will be removed
- Skips system folders — never touches
.git, OS files, or critical directories
Troubleshooting
devclean: command not found
# Check npm global bin path
npm config get prefix
# Add to your PATH (Linux/Mac)
export PATH="$(npm config get prefix)/bin:$PATH"
# Then reinstall
npm install -g dev-storage-cleanPermission denied when cleaning
# Fix folder permissions first
chmod -R 755 /path/to/folder
# Or run with sudo (use carefully)
sudo devclean cleanScan is too slow
# Use a smaller depth value
devclean scan --depth 2Project Structure
devclean/
├── bin/
│ └── devclean.js # CLI entry point
├── src/
│ ├── scan.js # Scanning engine
│ ├── clean.js # Cleaning logic
│ ├── cache.js # Cache management
│ ├── duplicate.js # Duplicate detection
│ ├── organize.js # File organizer
│ ├── stats.js # Usage statistics
│ ├── ui.js # Terminal UI
│ └── utils.js # Helpers
├── config/
│ └── stats.json # Saved statistics
└── package.jsonLocal Development
# Clone the repo
git clone https://github.com/sumitt-wayne/devclean.git
cd devclean
# Install dependencies
npm install
# Link for local testing
npm link
# Run
devcleanContributing
- Fork the repo
- Create a branch:
git checkout -b feature/your-feature - Make your changes and test them
- Commit:
git commit -m "Add: your feature" - Push:
git push origin feature/your-feature - Open a Pull Request
To report a bug or suggest a feature, open an issue.
Built With
- Commander.js — CLI commands
- Inquirer.js — Interactive prompts
- Chalk — Terminal colors
- Ora — Spinners
- cli-progress — Progress bars
- Boxen — Terminal boxes
- cli-table3 — Tables
License
MIT © Sumit Wayne
