SlimIt 0.3.2 is released. Go minify some JavaScript.

by Ruslan Spivak on May 9, 2011

New release is out and SlimIt 0.3.2 (http://slimit.org) can now minify JavaScript code.

Let’s do it from the command line:

$ slimit -h
Usage: slimit [input file]

If no input file is provided STDIN is used by default.
Minified JavaScript code is printed to STDOUT.

$ cat test.js
var a = function( obj ) {
        for ( var name in obj ) {
                return false;
        }
        return true;
};
$
$ slimit < test.js
var a=function(obj){for(var name in obj){return false;}return true;};

And using library API:

>>> from slimit import minify
>>> text = """
... var a = function( obj ) {
...         for ( var name in obj ) {
...                 return false;
...         }
...         return true;
... };
... """
>>> print minify(text)
var a=function(obj){for(var name in obj){return false;}return true;};

If you find any issues, please, submit them at GitHub.

Happy minifying :)

If you enjoyed this post why not subscribe via email or my RSS feed and get the latest updates immediately. You can also follow me on GitHub or Twitter.

Speak your mind

Previous post:

Next post: