# NAME

node-zopfli - A better-compression alternative to zlib deflate/inflate compression for node.js buffers.

eg. this can be used as a drop in replacement for gzip compression on your web server, and it'll give smaller sizes. see [this announcement](http://googledevelopers.blogspot.com.br/2013/02/compress-data-more-densely-with-zopfli.html)

streaming is coming soon...


# USAGE

Install with `npm install zopfli`.

    var Buffer = require('buffer').Buffer;
    var zopfli = require('zopfli');
    var input = new Buffer('lorem ipsum dolor sit amet');
    var compressed = zopfli.deflate(input);
    var output = zopfli.inflate(compressed);


# BUILDING

To obtain and build the bindings:

    git clone git://github.com/duralog/node-zopfli.git
    cd node-zopfli
    node-gyp rebuild


You can also use [`npm`](https://github.com/isaacs/npm) to download and install them:

    npm install zopfli



# TESTS

[expresso](https://github.com/visionmedia/expresso) is required to run unit tests.

    npm install -g expresso
    expresso


# USAGE FROM COMMAND-LINE

There is an executable called `zfip` which comes if you install globally

    npm install -g zopfli
    zfip fileiwanttocompress.js
    -> fileiwanttocompress.js.gz

# CONTRIBUTORS

* [Kenneth Bentley](https://github.com/duralog) node module, first version
* [Konstantin Käfer](https://github.com/kkaefer) orig zlib module, which I basically copied and pasted...


# FUTURE

 * working on making it a stream (duh)
 * usability improvements need to be made to the command `zfip`
 * fork gzippo and use it for express streaming (also, let's see if I can't upgrade its capabilites to use Express 3 too)
 * add progress events in a binding
 * fix the tests... lolz


# LICENSE

`zopfli` is [Apache-2.0 licensed](http://www.apache.org/licenses/LICENSE-2.0).
`node-zopfli` is [MIT licensed](http://opensource.org/licenses/MIT).
