This is a very nice thread. Thanks!
Well for me, I had 3 projects out of like 15+ in my dev folder that I didn't want the node_modules folder to be deleted.
My little workaround was to rename the node_modules of those projects to node_modules2 so it won't be affected by the script, then I turned it back after.
Yeah a lot of times I just wipe everything out, and go back to the recent projects and npm install again real quick. Check out npkill as well, you can interactively delete node_modules folders with it!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.