Ultra-fast node_modules cleanup tool powered by Bun.js
Faster than npkill with advanced interactive features and accurate size reporting
BunKill scans large directory trees, calculates folder sizes, and lets you delete selected node_modules folders from an interactive terminal UI or in batch mode.
- fast scanning for
node_modulesin large trees - concurrent size calculation with live progress
- interactive cleanup UI with keyboard selection
- interactive search after results load
- multiple sort modes
- largest first
- newest first
- oldest first
- name
- path
- developer-friendly badges in the UI
- package manager
- git branch / dirty state
- staged changes
- recently touched project marker
- dry-run and
--delete-allmodes - update checks with short timeout and clear status
- JS/Bun implementation only
- Bun runtime is required
- Supported platforms: macOS, Linux, Windows 10/11
- Windows: requires Windows Terminal for best interactive UI experience
Install Bun:
macOS / Linux:
curl -fsSL https://bun.sh/install | bashWindows (PowerShell):
powershell -c "irm bun.sh/install.ps1 | iex"npm install -g bunkillor
bun install -g bunkill# interactive scan in current directory
bunkill
# scan a specific directory (macOS / Linux)
bunkill --dir ~/Projects
# scan a specific directory (Windows)
bunkill --dir "C:\Users\YourName\Projects"
# preview only
bunkill --dir ~/Projects --dry-run
# delete everything found without interactive selection
bunkill --dir ~/Projects --delete-all
# limit traversal depth
bunkill --dir ~/Projects --depth 3
# check for updates manually
bunkill update --check-only--dir <directory>scan root, defaults to current directory--target <name>target folder name, defaults tonode_modules--exclude <patterns...>skip paths containing these substrings--exclude-hiddenskip hidden directories--hide-errorssuppress permission errors--full-scanscan from the home directory--depth <number>max traversal depth, default10--dry-runshow results without deleting--delete-alldelete all discovered targets without interactive selection
↑/↓movespaceselect current item/search loaded resultscclear searchaselect or clear all visible resultsscycle sort orderdtoggle detailsoopen directoryenterdelete selectedqquit
Search filters the already loaded list, so you can quickly narrow large result sets without rescanning.
| Platform | Status |
|---|---|
| macOS | ✅ Tested |
| Linux | |
| Windows 10/11 | ✅ Tested (Windows Terminal recommended) |
Windows note: Interactive mode requires a terminal that supports ANSI escape codes and raw mode. Windows Terminal works well. The legacy
cmd.exeprompt is not supported.
Recent real scan on --dir /Users/himanshum:
- completed in about
24.45s - found
265node_modulesdirectories
More benchmark notes:
BENCHMARK.mdbenchmark/installed-vs-local-benchmark.tsbenchmark/three-way-benchmark.ts
bun install
bun run check
bun run src/cli.ts --dir ~/Projects --dry-runsrc/cli.tsCLI entry pointsrc/scanner.tsscan and delete enginesrc/config.tsshared runtime and scan configsrc/types.tsshared typesbenchmark/benchmark scripts
Contributions are welcome.
Especially useful:
- Linux testing
- Windows testing
- terminal UI improvements
- scan performance improvements
- bug reports with reproducible directories or logs
If you are working on bunkill or want to contribute around that ecosystem, contributors can get a free on-chain URL from urls.bid dm me on x.
- BunKill uses Bun at runtime via
#!/usr/bin/env bun - the scanner is JS/Bun-only now
- the old Zig/native experiment was removed
- the name "BunKill" is a playful nod to "npkill" and reflects the Bun.js foundation of the tool