[Mac/Linux] List and remove all the node_modules at the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Cleanup node_modules | |
echo "Calculate disk space for node_modules in all directory" | |
find . -name "node_modules" -type d -prune -print | xargs du -chs | |
echo "Remove all node_modules directory" | |
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment