Clean Up Your node_modules with npKill 🧹✨
Randolph Mayson D. Dy
Posted on July 16, 2024
What is npKill? 🚀
npKill is a fantastic tool designed to help you find and remove old and heavy node_modules folders from your system. If you're like most developers, your projects can accumulate a lot of unnecessary files, and npKill can help you declutter and free up valuable space.
Why Use npKill? 🤔
As developers, we often jump between various projects, and each one has its own node_modules folder. Over time, these can take up significant space on your hard drive. Here’s how npKill can make your life easier:
- Clear Space: Easily identify and remove old node_modules directories that are no longer needed.
- Workspace Usage: Check when you last modified files in a workspace with the last_mod column.
- Fast Performance: Written in TypeScript with low-level searches for optimal performance.
- User-Friendly: No complicated commands—just list your node_modules and press Del to remove them.
- Minimal Dependencies: Lightweight and efficient.
Features at a Glance 🌟
- Easily Clear Space: Remove those bulky node_modules folders with a simple command.
- Last Workspace Usage: See the last time you modified a file in each workspace.
- High Speed: Enjoy quick searches and deletions, thanks to low-level performance optimizations.
- Ease of Use: Navigate and delete folders with simple key commands.
- Minimal Dependencies: Keep your system lean with a lightweight tool.
How to Install npKill 📦
You don’t need to install npKill to use it! Simply run:
bash
Copy code
$ npx npkill
But if you prefer to install it globally:
bash
Copy code
$ npm i -g npkill
# Unix users may need to run the command with sudo.
Note: NPKILL does not support node versions less than 14. For older versions, use npkill@0.8.3.
How to Use npKill 🛠️
Using npKill is straightforward:
bash
Copy code
$ npx npkill
# Or just npkill if installed globally
By default, npKill will start scanning for node_modules directories from the path where the command is executed. You can navigate the list with the ↓ and ↑ keys, and delete a folder by pressing Space or Del. Open the directory with o, and exit with Q or Ctrl + c.
Important Reminder ⚠️
Some applications require their node_modules directory to function correctly. npKill will highlight these with a ⚠️ symbol to remind you to proceed with caution.
Conclusion 🎉
npKill is an indispensable tool for any developer looking to maintain a clean and efficient workspace. Give it a try and see how much space you can reclaim!
Happy coding! 👨💻👩💻
For more details, visit the npKill page on npm.
Posted on July 16, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.