Skip to content

Instantly share code, notes, and snippets.

@jwulf
Created November 26, 2012 02:10
Show Gist options
  • Save jwulf/4146219 to your computer and use it in GitHub Desktop.
Save jwulf/4146219 to your computer and use it in GitHub Desktop.
var compress = function (buf, cb) {
console.log('before ' + buf);
zlib.gzip(buf, function (err, result) {
buf = result;
console.log('in buf ' + buf);
console.log('in string ' + buf.toString());
cb(buf)
});
};
>>>
before Hello World!
after Hello World!
in buf <BINARY GOBBLEDEGOOK>
in string <BINARY GOBBLEDEGOOK>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment