Dam dem node_modules!

If you’ve ever had to create a new project with the node package manager you’ll have seen it install a load of “dependencies” installed onto your simple project.  After a while you’ll end up with multiple projects and multiple folders of “node_modules”. No problem you say, but it will be when you start running out of space!

You can always reinstall them back with a;

npm install

Deletion:
Deleting one of these folders can take a few minutes so imagine having more than one project and “node_modules” for each project.  This can take up to many gigs of space depending on the project.

Solution npkill
this great util will allow you to delete multiple node_modules folders across different projects;

Source:
https://stackoverflow.com/questions/42950501/delete-node-modules-folder-recursively-from-a-specified-path-using-command-line

Simply running this command in the dir where you have many projects with node_modules will allow you to choose which projects you want to remove the installed dependancies from;

npx npkill