Skip to content

Instantly share code, notes, and snippets.

@jakl
Created April 24, 2013 05:42
Show Gist options
  • Save jakl/5449876 to your computer and use it in GitHub Desktop.
Save jakl/5449876 to your computer and use it in GitHub Desktop.
Functional browser gunzip
var binary_xhr = require('binary-xhr');
var zlib = require('zlib-browserify');
binary_xhr('data.gz', function(e, data){
zlib.gunzip(new Uint8Array(data), function(e, result){
console.log(e, result); // e: undefined, result: Buffer {0: 80, 1: 75, 2: 3, 3: 4, 4: 20...}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment