Dismiss
  • Toggle Theme
  • View as Mobile

Find all Javascript files in a project & count line numbers

Find all javascript files in a project, excluding node_modules and output their line number length

Useful for seeing what files might need refactoring.

# javascript-line-length.sh
find ./ -type f -name "*.js" -not -path "*/node_modules/*" -print0 | xargs -0 wc -l | sort -n >> files.txt | echo 'Done. See files.txt for stats'