Have you ever looked at your disk space and wondered, “Where did all my storage go?” If you’re a developer, chances are your drive is overflowing with forgotten node_modules
folders—those heavy, outdated, and often unnecessary directories created by your favorite JavaScript projects. I recently found myself in this exact situation, staring at a drive on the brink of bursting.
That’s when I discovered NPKILL, a lightweight, open-source tool designed to tackle this exact problem. In just minutes, I reclaimed over 200GB of space, and the process couldn’t have been easier. Here’s how I did it, and how you can too.
Why Do Node Modules Eat Up So Much Space?
Node modules are essential for JavaScript and Node.js projects, storing dependencies needed to run your code. The problem is, they’re massive and often end up forgotten in abandoned projects. These folders can pile up quickly, eating away at your storage without you realizing it.
So, how do you delete all node modules at once? The answer is NPKILL, a tool purpose-built for this task.
What is NPKILL?
NPKILL is a simple yet powerful utility that scans your system for node_modules
folders, lists their sizes, and lets you delete them with a single keystroke. It’s like a Marie Kondo for your disk space, helping you clear out the clutter effortlessly.
Key Features of NPKILL:
- Clear Space: Easily find and delete old and unused
node_modules
folders. - Fast and Efficient: Built for performance, NPKILL scans your directories at lightning speed.
- User-Friendly: Navigate a list of directories and delete them with a single press of the
Del
key. - Customizable: Use options to filter, sort, or exclude directories as needed.
How I Used NPKILL to Delete 200GB of Node Modules
Here’s a quick walkthrough of how I used NPKILL to reclaim my storage:
Step 1: Install or Run NPKILL
The best part? You don’t even need to install it! Simply run the following command to start using NPKILL:
npx npkill
If you prefer installing it globally, you can do so with:
npm i -g npkill
Step 2: Scan for Node Modules
By default, NPKILL starts scanning from the directory you’re in. You can also specify a starting directory with:
npkill -d ~/projects
Within seconds, I had a complete list of all the node_modules
folders on my drive, sorted by size.
Step 3: Delete with Confidence
Using the arrow keys, I navigated through the list and selected the folders I no longer needed. A quick press of the Del
key, and voilà—the space was mine again.
NPKILL even highlights critical folders that might be essential for active projects, so I knew exactly what to avoid deleting.
Why NPKILL is the Fastest Way to Remove Node Modules
I’ve tried other methods, from manual deletion to custom scripts, but nothing beats NPKILL for its speed and simplicity. It eliminates the need for lengthy commands or worrying about accidental deletions.
Plus, if you’re wondering, “How do I delete all unused node modules at once?”, NPKILL has a --delete-all
option for bulk cleanups. Combine that with the --exclude
flag to ignore certain directories, and you’ve got a powerful tool that works exactly how you need it to.
Final Thoughts: Clean Up Your Drive Today
In just a few minutes, NPKILL helped me clear 200GB of wasted space, breathing new life into my drive. Whether you’re struggling with limited storage or just want a cleaner system, this tool is a must-have for every developer.
So, the next time you find yourself asking:
- “What is the fastest way to remove node modules?”
- “How do I delete all node modules at once?”
Remember, the answer is simple: NPKILL.
Ready to Try NPKILL?
Give it a spin today:
npx npkill
Your storage (and sanity) will thank you!
Comments....