Skip to content

Instantly share code, notes, and snippets.

@Aldaviva
Created January 18, 2023 09:36
Show Gist options
  • Save Aldaviva/a1d18b533df6fe07874518e8aa63d1be to your computer and use it in GitHub Desktop.
Save Aldaviva/a1d18b533df6fe07874518e8aa63d1be to your computer and use it in GitHub Desktop.
Count non-whitespace lines of code in a directory
grep --include '*.js' --recursive --invert-match --line-regexp --count --exclude-dir='lib' --exclude-dir='thirdparty' --exclude-dir='vendor' '\s*' . | awk -F : '{ sum += $2 } END { print sum }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment