npkill logo

npkill npm version

Easily find and remove old and heavy node_modules folders

$ npm i -g npkill

Installation

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 and will show the node_modules directories next to their size.

Start search npkill

Use

You can 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.

delete node_modules

Options

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 or path [ beta ] none
-t, --target Specify the name of the directories you want to search node_modules
-v, --version Show npkill version false
In future versions some commands may change

Examples

Search node_modules directories in your projects directory

$ npkill -d ~/projects

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...