Free up gigabytes of disk space by deleting node_modules from old JavaScript projects you no longer use.
Bulk-delete groups of node_modules folders using multi-select and range selection in one step.
Sort project folders by size or last-modified date to identify the oldest unused ones first.
Run without installing anything by typing npx npkill in any terminal.
Npkill is a command-line tool that scans your computer for node_modules folders and shows you how much disk space each one is taking up. Node_modules folders are directories that JavaScript and Node.js projects download to store their dependencies, and they can grow very large over time. On a machine with many old projects, these folders can collectively consume gigabytes of space even when you no longer use the projects. Once npkill lists the folders it finds, you navigate the list with arrow keys and press Space or Delete to remove whichever ones you want to clear out. The tool also shows when you last modified files in each project, which helps you identify old work you are unlikely to return to. You do not need to install the tool permanently: running npx npkill in a terminal is enough to use it. For situations where you want to clean up many folders at once, the tool has a multi-select mode. You can toggle it on, mark individual folders or use range selection to select a group, then delete them all in one step. There is also a search mode where you type a pattern to filter the list down to specific folders or paths. Additional options let you set where the scan starts, exclude certain directories, sort results by size or last-modified date, and choose which kinds of target directories to look for beyond just node_modules. The tool warns you if a folder belongs to a system-level application where deletion could cause problems. Npkill is written in TypeScript and has very few external dependencies. It is licensed under the MIT license.
← voidcosmos on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.