Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Js-Beautify recursively git hook
type js-beautify >/dev/null 2>&1 || { echo >&2 "js-beautify command missing. Installing now."; sudo npm install -g js-beautify; }
find . -type f -name "*.js" -not -path "*node_modules*" -exec js-beautify -r {} \;

This comment has been minimized.

Copy link

@AshKyd AshKyd commented Dec 2, 2015

If you have xargs on your system, you can use the following multi-process version (where -P4 equals 4 threads):

find src/ test/ -type f -name "*.js" -not -path "*node_modules*"| xargs -P4 js-beautify -r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment