Skip to content

Instantly share code, notes, and snippets.

@jikkujose
Last active July 30, 2020 14:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jikkujose/692ef731a7a496d9c24d04abcd8bf50e to your computer and use it in GitHub Desktop.
Save jikkujose/692ef731a7a496d9c24d04abcd8bf50e to your computer and use it in GitHub Desktop.
Manage node_modules. See how much storage they consume & remove them.
alias nm_weight="find . -name 'node_modules' -type d -prune -print0 | xargs -0 du -chs"
alias nm_delete="find . -name 'node_modules' -type d -prune -print0 | xargs -0 rm -rf"
[~/Projects] $ nm_weight
129M ./dojo/02 - Game of Life/username/typescript/node_modules
133M ./dojo/03 - Mandelbrot Set/username/node_modules
406M ./BCProject/code/mobile/BCProject/node_modules
224M ./main/node_modules
319M ./count_tracker/node_modules
236M ./SB/exercism/username/reasonml/two-fer/node_modules
241M ./SB/exercism/username/reasonml/hello-world/node_modules
322M ./covid_tracker/node_modules
113M ./hello-netlify-functions/node_modules
2.1G total
[~/Projects] $ nm_delete
[~/Projects] $ nm_weight
[~/Projects] $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment