Wrapper for zlib.js to allow for browserifyication
npm install zlib-browserify
|7 605||downloads in the last day|
|115 926||downloads in the last week|
|373 440||downloads in the last month|
|Version||0.0.3 last updated 5 months ago|
|Dependents (9)||browser-builtins, browserify, commonjs-everywhere, core-modules, grunt-file-info, gzip-size, mdbp-mobile-first-dombo, needy-nodecore, node-libs-browser|
Zlib in yo' browser.
What is this?
This is a very small wrapper for https://github.com/imaya/zlib.js. Fixes
some very minor API inconsistencies. Only implements
gunzip so if you're doing anything extra fancy
you're out of luck for now.
$ npm test
Test methodology (a.k.a, "why doesn't the output match node's zlib?")
(zlibA = native, zlibB = browserified)
Pretending these are sync, I do the following to test:
assert(zlibB.inflate(zlibA.deflate('test')) === "test"); assert(zlibA.inflate(zlibB.deflate('test')) === "test"); ...
and so on for each of the methods supported. Note, I do not do
assert(zlibA.deflate('test') === zlibB.deflate('test'));
Because node's deflate and the imaya's version do not seem to use the
same defaults for compression level. I haven't figured out how to change
it yet. Anyway, rest assured, while
deflate does not return the same
output, this is fully interoperable with node's native zlib.