Skip to content

Fishrock123/zlib-transform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A zlib transform for the BOB streaming protocol.

Resources

License

Stars

Watchers

Forks

Packages

No packages published