zlib-transform
v0.0.4
Published
A zlib transform for the BOB streaming protocol.
Downloads
22
Maintainers
Readme
Zlib Transform (BOB)
A zlib transform for the BOB streaming protocol.
Usage
Note: This currently requires the --expose-internals
Node.js flag & Node.js built from master
.
const ZlibTransform = require('zlib-transform')
new ZlibTransform(options, mode)
Implements a BOB transform for doing zlib compression / decompression.
Example
const zlib = require('zlib')
const ZlibTransform = require('zlib-transform')
const transform = new ZlibTransform({}, zlib.constants.GZIP)
const source = new MyBOBSource()
const sink = new MyBOBSink()
sink.bindSource(transform.bindSource(source), error => {
if (error)
console.error('Stream returned error ->', error.stack)
else {
console.log('ok')
}
})
See test-basic for a good working example.