Skip to content

Instantly share code, notes, and snippets.

@bjorne
Created June 15, 2012 08:04
Show Gist options
  • Save bjorne/2935316 to your computer and use it in GitHub Desktop.
Save bjorne/2935316 to your computer and use it in GitHub Desktop.
Diff compressed Javascript files by beautifying them first
#!/bin/bash
UGLIFY=`which uglifyjs`
ARGS="--beautify"
F1=/tmp/$RANDOM
F2=/tmp/$RANDOM
cat $1 | $UGLIFY $ARGS > $F1
cat $2 | $UGLIFY $ARGS > $F2
diff $F1 $F2 | less
rm $F1 $F2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment