zlib-transform

A zlib transform for the BOB streaming protocol.


Keywords
BOB, streams, stream, pull, zlib, transform, compress, compression
License
MIT
Install
npm install zlib-transform@0.0.4

Documentation

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.

License

MIT LicensedContributions via DCO 1.1