zpipe is not a pipe.
The famous pipe. How people reproached me for it! And yet, could you stuff my pipe? No, it's just a representation, is it not? So if I had written on my picture "This is a pipe," I'd have been lying!
- Currently no compression API exposed in browsers
- Help users suffering from poor upload bandwidth
<script> include ...
With require() ...
var zpipe = require("zpipe"); var deflated = zpipe.deflate("the balloon"); var inflated = zpipe.inflate(deflated); // "the balloon"
zpipe is supported in the following browsers:
- Internet Explorer 7+ (Note: Use zpipe-native)
- Google Chrome
- Mozilla Firefox
Install the package with npm
$ npm install zpipe
and bundle it with Browserify.
$ browserify example.js -o bundle.js
Alternatively just add it to your Ender bundle.
$ ender add zpipe
But it's so big!
Ok 201 KB for
zpipe.min.js is big, however it comes in at 57.6 KB gzipped. This is acceptable.
Test against node zlib bindings:
$ make test
Run the test in the browser by pointing your browser to
zpipe operates on octet strings only, multi-byte characters will have their high byte masked. If you want to handle multi-byte characters then you must convert your strings to UTF-8 prior to calling
deflate() and then convert them back after calling
- Support stream compression through workers