Created
September 10, 2023 15:34
-
-
Save Hebilicious/7e86fd75c5be3cccae730585021be9ba to your computer and use it in GitHub Desktop.
Fast recursive delete node modules directories
This file contains hidden or 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
#paste this in your .bashrc/.zshrc file | |
purgenodemodules() { | |
perl -e 'use File::Find; find(sub { unlink $File::Find::name if (-f && $File::Find::dir =~ /node_modules/) }, ".")' && find . -name 'node_modules' -type d -exec rm -rf {} + | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment