node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป


A hook to compress and uncompress files. Operates synchronously for now

NOTE: Pull request making this asynchronous are very welcome as long as they work with huge (2+ gigabyte compressed) files.

Gzbz2 Icon

Build Status


npm install -g



This starts a hook and reads the local config.json. The files listed there will be compressed or uncompressed. A sample is provided in examples/example-config.json. The config option is included for debugging and testing purposes, in general you will want to use messages and code.


gzbz2::compress [in]

source: the source file name. Required. This is the file that will be compressed.
target: the target file name. Required.
mode: 'gzip' or 'bzip2', defaults to 'gzip'

gzbz2::uncompress [in]

source: the source file name. Required. This is the file that will be uncompressed.
target: the target file name. Required.

gzbz2::error [out]

code: code

gzbz2::compress-complete [out]

code: code

gzbz2::uncompress-complete [out]

target : The target file name. Schema support

The package config contains experimental schema definitions. The definition is also exported as hook. Signatures will be served from a signature server (more to come).


Gzbz2 = require("").Gzbz2
hook = new Gzbz2(name: 'gzbz2')


var Gzbz2 = require("").Gzbz2;
var hook = new Gzbz2({ name: 'gzbz2' });

Advertising :)

Check out

Follow us on Twitter at

  • @getscottyapp
  • @martin_sunset

and like us on Facebook please. Every mention is welcome and we follow back.


Listened to lots of M.I.A. and Soundgarden while writing this.

Release Notes


  • Minor cleanups, including coffee-script beautification


  • First version

Internal Stuff

  • npm run-script watch

Publish new version

  • Change version in package.json
  • git tag -a v0.0.2 -m 'version 0.0.2'
  • git push --tags
  • npm publish

Contributing to

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
  • Fork the project
  • Start a feature/bugfix branch
  • Commit and push until you are happy with your contribution
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the package.json, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.


Copyright (c) 2011 Martin Wawrusch. See LICENSE for further details.