Skip to content

Instantly share code, notes, and snippets.

@Hebilicious
Created September 10, 2023 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hebilicious/7e86fd75c5be3cccae730585021be9ba to your computer and use it in GitHub Desktop.
Save Hebilicious/7e86fd75c5be3cccae730585021be9ba to your computer and use it in GitHub Desktop.
Fast recursive delete node modules directories
#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