I have multiple npm projects saved in a local directory. Now I want to take backup of my projects without the node_modules
folder, as it is taking a lot of space a
bash
function to remove node_modules
. It will remove all node_modules
directories recursively from the current working directory,
while printing found paths.
You just need to put in somewhere in your $PATH
rmnodemodules(){
find . -name 'node_modules' -type d -prune -exec echo '{}' \; -exec rm -rf {} \;
}