jsobf – command line tips

Here are some quick tips on how to use the jsobf command line program effectively.

Install the program under one of your search paths so you can just type jsobf from anywhere in your file system:
$ mv/path/to/jsobf ~/bin/jsobf

Direct output into a destination file, and log any errors in a separate file:

$ jsobf file.js 1>target.js 2>jsobf.log

Pipe source code into jsobf from another program:

$ cat file.js | jsobf

Pipe obfuscated code into another program; here the jsfmt program formats the obfuscated source so you can take a better look at it:

$ cat file.js | jsobf 2>/dev/null | jsfmt

Last but not least – get the js shell from Mozilla, it’s very handy!
http://developer.mozilla.org/En/Introduction_to_the_JavaScript_shell