Created
April 24, 2013 05:42
-
-
Save jakl/5449876 to your computer and use it in GitHub Desktop.
Functional browser gunzip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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