Skip to content

Instantly share code, notes, and snippets.

@tj
Created January 10, 2012 23:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tj/1592038 to your computer and use it in GitHub Desktop.
Save tj/1592038 to your computer and use it in GitHub Desktop.
grep .emit() calls
#!/usr/bin/env bash
echo
find ${1:-.} -name "*.js" \
| xargs cat \
| grep '.emit(' \
| sed 's/.*.emit(//g' \
| sed -E "s/,|'|); *$//g" \
| awk '{
printf " \033[36m%-10s\033[0m", $1
for (i = 2; i <= NF; ++i)
printf " \033[90m%s\033[0m", $i
printf "\n"
}'
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment