A fast, interactive Rust CLI tool to scan for node_modules directories, view their sizes, and delete them with a single keypress.
- Parallel scanning: Uses multi-threaded directory traversal and size calculation for fast scans across large workspaces.
- Interactive TUI: Navigate with arrow keys (
↑/↓ork/j) and pressEnterto delete immediately. - Smart exclusions: Skips nested
node_modulesinsidenode_modulesas well as.git,target,.cargo,.rustup, Python virtual environments, and OS/system directories. - Sorted by size: Largest
node_modulesfolders appear at the top. - Safe options: Supports
--listfor dry-run inspection and--min-size <MB>to filter small folders.
Download the latest binary for Windows (.exe), macOS, or Linux (.tar.gz) from the Releases page and run it directly (or place it in a folder on your PATH).
cargo install --git https://github.com/paaiz/node-modules-cleanerOr clone and install locally:
git clone https://github.com/paaiz/node-modules-cleaner
cd node-modules-cleaner
cargo install --path .# Scan the current directory and open interactive mode
node-modules-cleaner
# Scan a specific folder
node-modules-cleaner --path "C:\Users\you\Projects"
# Only show folders >= 50 MB
node-modules-cleaner --min-size 50
# List results without entering interactive mode
node-modules-cleaner --list
# Delete all found node_modules without confirmation (use with caution)
node-modules-cleaner --delete --yes| Key | Action |
|---|---|
↑ / k |
Move selection up |
↓ / j |
Move selection down |
Enter |
Prompt to delete the selected node_modules folder (press Enter again to confirm, or any other key to cancel) |
q / Esc / Ctrl+C |
Exit |
Created with ❤️ by @paaiz