Delete node_modules like a Pro

Nirazan Basnet
2 min readApr 5, 2021

Usually, while working on multiple projects we complain about the hard drive which is mystically always full.

Whenever we start a new project and run npm install, it downloads a bunch of javascript files in the node_modules folder and we don’t care about this after we abandoned the project.

Even after knowing we delete the node_modules by right-clicking it

find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +

And if there is a pro developer then we use the bash command which deletes the directories from the current working directory

But the smartest way to get the job done is to run

npm npkill

So, 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

It easily finds and removes old and heavy node_modules folders

To know more information about npkill, you can visit the site here

Conclusion

👏👏 By coming this far I hope you can use this awesome npkill npm package. So, I suggest you give it a try on your project and enjoy it!

Feel free to share your thoughts and opinions and leave me a comment if you have any problems or questions.

Till then,
Keep on Hacking, Cheers

Originally published at https://dev.to on April 5, 2021.

--

--

Nirazan Basnet

Creative coder, Dreamer, Design lover, Passionate about UI/UX experience & Front-end Engineer. https://nirajanbasnet.com.np , https://codepen.io/nirazanbasnet