npkill logo


package version

Easily find and remove old and heavy node_modules folders

$ npm i -g npkill


Installation through npm is simple. Make sure you have installed node and npm and then run npm i -g npkill .
You can also use it without installing it by running npx npkill

First Steps

Simply go from the terminal to the directory from which you want to search and type npkill .

This will start the search loading symbol and will show the node_modules directories next to their size and the age of the workspace.

Start search npkill


Use the cursor arrows to move up or down .
Pressing the Space key will erase the directory in which the cursor is located, freeing up that valuable space.

To exit, q, or Ctrl + c if you're brave.

Advance usage

For move up: up or k.
For move down: down or j.
For scroll one page up: PgUp, l or Ctrl+u.
For scroll one page down: PgDown, h or Ctrl+d.
For go to the first or last result: HOME/END.

delete node_modules


Arg Description Default
-c, --bg-color Change row highlight color. Available: blue, cyan, magenta, white, red and yellow blue
-d, --directory Set the directory from which to begin searching .
-D, --delete-all CURRENTLY DISABLED. Automatically delete all node_modules folders that are found. --
-e, --show-errors Show error messages if any false
-E, --exclude Exclude directories from search (directory name list must be inside double quotes "", each directory separated by ',' ) Example: "ignore1, ignore2" --
-f, --full Start searching from the home of the user (example: "/home/user" in linux) false
-gb Show folders size in Gigabytes instead of Megabytes false
-h, --help, ? Show help false
-nu, --no-check-update Dont check for updates on startup false
-s, --sort Sort results by: size, path or last-mod none
-t, --target Specify the name of the directories you want to search node_modules
-x, --exclude-hidden-directories Exclude hidden directories ("dot" directories) from search. false
-v, --version Show npkill version false
In future versions some commands may change


Search node_modules directories in your projects directory and ignore unwanted results (hidden files for example):

$ npkill -d ~/projects -x

Displays the magenta color cursor... because I like magenta!

$ npkill --color magenta

List directories called "dist" and and show errors if any occur:

$ npkill --target dist -e

List vendor directories in your projects directory, sort by size, and show that in gb:

$ npkill -d '~/more projects' -gb --sort size --target vendor
View on GitHub View on npm

Main devs Under construction

Nya García dev

Nya García

NodeJS TypeScript Angular Php more...
Juan Torres dev

Juan Torres

NodeJS TypeScript Angular Php more...