I'm getting contents of a gzipped web page in chunks and want to decompress each as soon as it gets received, so I'm trying to do (stuff stripped for readability):
var decompress = function(string, callback) {
zlib.gunzip(string, callback);
};
decompress(chunk, function(data) {
console.log(data);
});
However I'm only getting null
s logged to the console. My node version is 0.6.2 and zlib
is the built-in one. How should I decompress it?