Every time you start a new node project you will have a node_modules directory in your projectsβ directory. Usually we forget about it, and it still lives there happily even after we have stopped developing.
This is obviously a waste of space on your hard drive. Cleaning this up by hand is too annoying and writing a script is too complicated to be worth it though.
bash
npx npkill
This neat little command will traverse your file system and list all you node_modules directories for you to delete.
For this to work properly you should be in the directory where your projects are placed.
Thatβs all, I hope you find this little trick as nice as I do.