zlib.md 1.5 KB

Class: Zlib

Streaming Zlib compression

Hierarchy

  • Zlib

Index

Constructors

Properties

Methods

Constructors

constructor

+ new Zlib(opts: ZlibOptions, cb?: FlateStreamHandler): Zlib

Creates a Zlib stream

Parameters:

Name Type Description
opts ZlibOptions The compression options
cb? FlateStreamHandler The callback to call whenever data is deflated

Returns: Zlib

+ new Zlib(cb?: FlateStreamHandler): Zlib

Creates a Zlib stream

Parameters:

Name Type Description
cb? FlateStreamHandler The callback to call whenever data is deflated

Returns: Zlib

Properties

ondata

ondata: FlateStreamHandler

The handler to call whenever data is available

Methods

push

push(chunk: Uint8Array, final?: boolean): void

Pushes a chunk to be zlibbed

Parameters:

Name Type Description
chunk Uint8Array The chunk to push
final? boolean Whether this is the last chunk

Returns: void