npkill vs SweepBar: two ways to clean node_modules on a Mac
Both tools find node_modules folders and delete the ones you choose. They are built for different people. npkill is a free terminal tool that gives you control over any folder. SweepBar is a menu bar app that offers only what it considers safe. This page compares them from npkill’s own README and release notes and from how SweepBar works.
At a glance
| npkill | SweepBar | |
|---|---|---|
| Interface | Terminal | Menu bar app |
| Run it | npx npkill, or install it globally with npm |
Download, open from the menu bar |
| Price | Free, open source (MIT) | Scan is free, $5.99 once to unlock sweeping |
| Finds | node_modules below the folder where you start it |
node_modules, Pods and other build folders of old projects |
| Other targets | Yes, by name with -t, for example .cache, and profiles |
Fixed list of known folders |
| Shows sizes | Yes, plus when the workspace was last modified | Yes |
| Preview mode | Yes, --dry-run |
Asks before every sweep |
| Which folders | Any you pick, including active projects | Only projects untouched for 60 days |
| Delete all at once | Yes, --delete-all, suggested with -x |
Tick the rows, confirm once |
| Also clears caches | Not described | Yes: npm, pnpm, Yarn, Bun, Xcode, Gradle, IDEs |
| Watches free space | Not described; you run it when you want | Yes, a threshold you set |
Where npkill is the better choice
- You like the terminal and want it free. One
npxcommand, nothing to install, MIT licensed. - You want to pick any folder, active or not. It lists everything it finds from the folder where you start, with a last-modified column, and lets you delete what you want.
- You want other folder names. The
-toption takes your own targets, for examplenode_modules,.cache. - You want to rehearse.
--dry-runsimulates deletion without removing anything.
npkill’s README also warns that some apps installed on the system need their own node_modules to work, and it marks those with a warning symbol. It lists known bugs as well, such as sizes sometimes being higher than they should be. Read it before you run --delete-all.
Where SweepBar is different
- It protects active projects. A folder is offered only if the project has not changed for 60 days, git ignores the folder, and a marker file proves the ecosystem. All of that is checked again right before deleting.
- It is not only
node_modules. The same scan coversPodsand other rebuildable folders, and SweepBar also clears package caches, Xcode folders and IDE caches in the same list. - It watches in the background. It tells you when free space gets low instead of waiting until you remember to run a command.
- It blocks while a tool is running. A row is disabled while npm, Gradle or the app that uses it is open.
What neither does
Neither removes your source code. Both can only delete folders that tools can recreate, but a folder you delete still has to be downloaded again. For what that costs, see Can I delete node_modules? and how to delete all node_modules folders safely.
Which one to pick
- Terminal, free, full control: npkill.
- A menu bar app that stays out of active projects and covers more than
node_modules: SweepBar. - Both: fine. Use npkill for a one-off clean of a specific tree, SweepBar to keep the disk healthy.
Sources
Facts about npkill come from its own public pages, read on October 23, 2026. Things change, so check them before you decide.
Quick answers
Is npkill free?
Yes. It is open source under the MIT license, and its README asks for donations rather than payment.
Can SweepBar delete node_modules in a project I am working on?
No. By design it only offers project folders when nothing in the project has changed for 60 days, git ignores the folder, and a marker file such as package.json proves what the project is.
Which is safer?
They protect you in different ways. npkill shows the folders and marks those some apps need to run, but you choose what to delete. SweepBar limits what it offers to old, git-ignored folders and checks again just before deleting. Either way, node_modules can be reinstalled but check before you delete.