rmnode
v1.1.0
Published
Fast and beautiful CLI tool to find and remove node_modules folders to free up disk space
Maintainers
Readme
rmnode
$$$$$$\ $$$$$$\$$$$\ $$\ $$\ $$$$$$\ $$$$$$\ $$$$$$\
$$ __$$\ $$ _$$ _$$\ $$$\ $$ |$$ __$$\ $$ __$$\ $$ __$$\
$$ | \__|$$ / $$ / $$ |$$$$\ $$ |$$ / $$ |$$ / $$ |$$$$$$$$ |
$$ | $$ | $$ | $$ |$$ $$\$$ |$$ | $$ |$$ | $$ |$$ ____|
$$ | $$ | $$ | $$ |$$ \$$$$ |$$ | $$ |$$ | $$ |$$ |
$$ | $$ | $$ | $$ |$$ |\$$$ |$$ | $$ |$$ | $$ |$$ |
$$ | $$ | $$ | $$ |$$ | \$$ |\$$$$$$ |\$$$$$$$ |\$$$$$$$\
\__| \__| \__| \__|\__| \__| \______/ \_______| \_______|Features
- Instant startup - Results appear in milliseconds, not seconds
- Beautiful TUI - Interactive terminal interface with colors
- Fast scanning - Parallel directory scanning
- Smart filtering - Skips nested node_modules and system directories
- Search - Filter projects by name or path
- Multi-select - Select multiple folders to delete at once
- Safe - Confirmation before deletion, dry-run mode available
- Non-blocking - Continue browsing while deletion happens in background
Installation
# Run directly with npx (no install needed)
npx rmnode
# Or install globally
npm install -g rmnodeUsage
# Scan current directory
rmnode
# Scan specific path
rmnode --path ~/projects
# Dry run (show what would be deleted without deleting)
rmnode --dry-runKeyboard Shortcuts
| Key | Action |
|-----|--------|
| j / ↓ | Move down |
| k / ↑ | Move up |
| Space | Select/deselect item |
| Enter | Select and move to next |
| a | Select all |
| c | Clear selection |
| s / / | Search |
| d | Delete selected |
| q | Quit |
| Esc | Close search / Clear filter |
Screenshots
Main Interface
Found: 15 Total: 2.5 GB Selected: 3 Size: 850 MB
... 2 more above
> [x] my-project 450.5 MB ~/projects/my-project/node_modules
[ ] another-app 125.3 MB ~/projects/another-app/node_modules
[x] old-website 275.8 MB ~/projects/old-website/node_modules
[ ] test-repo 45.2 MB ~/projects/test-repo/node_modules
... 8 more below
j/k: navigate | space: select | a: all | s: search | d: delete | q: quitSearch Mode
Search: react_ (Esc to close, Enter to keep filter)How It Works
- Scans your filesystem for
node_modulesdirectories - Calculates the size of each folder
- Displays results sorted by size (largest first)
- Deletes selected folders in parallel using native
rm -rf
What Gets Skipped
rmnode automatically skips:
- Nested
node_modules(inside other node_modules) - Package manager caches (
.npm,.yarn,.pnpm) - System directories (
Library,Applications, etc.) - Hidden directories
Project Structure
src/
├── components/ # React components (Ink TUI)
│ ├── App.tsx # Main application
│ ├── MainView.tsx # Main interface
│ ├── Item.tsx # List item component
│ ├── NodeModulesList.tsx
│ ├── StatsBar.tsx
│ └── ConfirmDialog.tsx
├── hooks/ # React hooks
│ ├── useScanner.ts # File scanning
│ ├── useSelection.ts # Selection state
│ └── useKeyboard.ts # Keyboard input
├── scanner/ # Core scanning logic
│ └── index.ts
├── utils/
│ ├── format-size.ts
│ └── delete-folder.ts
├── types.ts
├── cli.ts
└── index.tsxRequirements
- Node.js 18.0.0 or higher
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development
# Clone the repo
git clone https://github.com/firaslatrach/rmnode.git
cd rmnode
# Install dependencies
npm install
# Run in development
npm run dev
# Build
npm run buildLicense
MIT License - see LICENSE file for details.
Author
Firas Latrach
- Website: firaslatrach.vercel.app
- GitHub: @firaslatrach
