Minify command-line tool
.min.js version will be created for you in the same directory. So the following will create
$ minify jquery.myplugin.js
You can also pass more paths and it will concat and minify them into a single file - the last argument is always the output file:
$ minify input.js output.min.js $ minify a.js few.js files.js output.min.js
Internally it uses Google’s Closure Compiler via the closure-compiler Gem (which requires Java and, obviously, Ruby) so all the hard work has already been done for me.
I’ve been writing a few command-line tools like this one, it feels great to scratch your own itch. I also recently wrote
ding which - yes you may chuckle - I find surprisingly useful!