Skip to content

Instantly share code, notes, and snippets.

@siberex
Last active July 26, 2022 11:21
Show Gist options
  • Save siberex/0f26aae943a15b9277ea0273bdaebb97 to your computer and use it in GitHub Desktop.
Save siberex/0f26aae943a15b9277ea0273bdaebb97 to your computer and use it in GitHub Desktop.
Find all top-level node_modules and show each folder size
find . -name 'node_modules' -type d -not -path '*/node_modules/*/node_modules' -exec du -hs '{}' \;
# alias find_node_modules="find . -name 'node_modules' -type d -not -path '*/node_modules/*/node_modules' -exec du -hs '{}' \;"
# Same with dist, excludiong vendored thirdparty-js :
# find . -name 'dist' -type d -not -path '*/thirdparty-js/*/dist' -exec du -hs '{}' \;
# find . -name 'node_modules' -type d -not -path '*/node_modules/*/node_modules' -not -path '*/thirdparty-js/*/node_modules' -exec du -hs '{}' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment