This provides bindings to Gzip/Gunzip, Deflate/Inflate, and DeflateRaw/InflateRaw classes. Each class takes the same options, and is a readable/writable Stream.

Static variables

staticread onlyZ_ASCII:Int

staticread onlyZ_BEST_COMPRESSION:Int

staticread onlyZ_BEST_SPEED:Int

staticread onlyZ_BINARY:Int

Possible values of the data_type field.

staticread onlyZ_BLOCK:Int

staticread onlyZ_BUF_ERROR:Int

staticread onlyZ_DATA_ERROR:Int

staticread onlyZ_DEFAULT_COMPRESSION:Int

staticread onlyZ_DEFAULT_STRATEGY:Int

staticread onlyZ_DEFLATED:Int

The deflate compression method (the only one supported in this version).

staticread onlyZ_ERRNO:Int

staticread onlyZ_FILTERED:Int

Compression strategy.

staticread onlyZ_FINISH:Int

staticread onlyZ_FIXED:Int

staticread onlyZ_FULL_FLUSH:Int

staticread onlyZ_HUFFMAN_ONLY:Int

staticread onlyZ_MEM_ERROR:Int

staticread onlyZ_NEED_DICT:Int

staticread onlyZ_NO_COMPRESSION:Int

Compression levels.

staticread onlyZ_NO_FLUSH:Int

Allowed flush values.

staticread onlyZ_NULL:Int

For initializing zalloc, zfree, opaque.

staticread onlyZ_OK:Int

Return codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events.

staticread onlyZ_PARTIAL_FLUSH:Int

staticread onlyZ_RLE:Int

staticread onlyZ_STREAM_END:Int

staticread onlyZ_STREAM_ERROR:Int

staticread onlyZ_SYNC_FLUSH:Int

staticread onlyZ_TEXT:Int

staticread onlyZ_TREES:Int

staticread onlyZ_UNKNOWN:Int

staticread onlyZ_VERSION_ERROR:Int

Static methods

staticcreateDeflate(?options:Null<ZlibOptions>):Deflate

Returns a new Deflate object with an options.

staticcreateDeflateRaw(?options:Null<ZlibOptions>):DeflateRaw

Returns a new DeflateRaw object with an options.

staticcreateGunzip(?options:Null<ZlibOptions>):Gunzip

Returns a new Gunzip object with an options.

staticcreateGzip(?options:Null<ZlibOptions>):Gzip

Returns a new Gzip object with an options.

staticcreateInflate(?options:Null<ZlibOptions>):Inflate

Returns a new Inflate object with an options.

staticcreateInflateRaw(?options:Null<ZlibOptions>):InflateRaw

Returns a new InflateRaw object with an options.

staticcreateUnzip(?options:Null<ZlibOptions>):Unzip

Returns a new Unzip object with an options.

staticdeflate(buf:EitherType<String, Buffer>, callback:(Error, Buffer) ‑> Void):Void

staticdeflate(buf:EitherType<String, Buffer>, options:ZlibOptions, callback:(Error, Buffer) ‑> Void):Void

Compress a string with Deflate.

staticdeflateRaw(buf:EitherType<String, Buffer>, callback:(Error, Buffer) ‑> Void):Void

staticdeflateRaw(buf:EitherType<String, Buffer>, options:ZlibOptions, callback:(Error, Buffer) ‑> Void):Void

Compress a string with DeflateRaw.

staticdeflateRawSync(buf:EitherType<String, Buffer>, ?options:Null<ZlibOptions>):Buffer

Compress a string with DeflateRaw (synchronous version).

staticdeflateSync(buf:EitherType<String, Buffer>, ?options:Null<ZlibOptions>):Buffer

Compress a string with Deflate (synchronous version).

staticgunzip(buf:EitherType<String, Buffer>, callback:(Error, Buffer) ‑> Void):Void

staticgunzip(buf:EitherType<String, Buffer>, options:ZlibOptions, callback:(Error, Buffer) ‑> Void):Void

Decompress a raw Buffer with Gunzip.

staticgunzipSync(buf:EitherType<String, Buffer>, ?options:Null<ZlibOptions>):Buffer

Decompress a raw Buffer with Gunzip (synchronous version).

staticgzip(buf:EitherType<String, Buffer>, callback:(Error, Buffer) ‑> Void):Void

staticgzip(buf:EitherType<String, Buffer>, options:ZlibOptions, callback:(Error, Buffer) ‑> Void):Void

Compress a string with Gzip.

staticgzipSync(buf:EitherType<String, Buffer>, ?options:Null<ZlibOptions>):Buffer

Compress a string with Gzip (synchronous version).

staticinflate(buf:EitherType<String, Buffer>, callback:(Error, Buffer) ‑> Void):Void

staticinflate(buf:EitherType<String, Buffer>, options:ZlibOptions, callback:(Error, Buffer) ‑> Void):Void

Decompress a raw Buffer with Inflate.

staticinflateRaw(buf:EitherType<String, Buffer>, callback:(Error, Buffer) ‑> Void):Void

staticinflateRaw(buf:EitherType<String, Buffer>, options:ZlibOptions, callback:(Error, Buffer) ‑> Void):Void

Decompress a raw Buffer with InflateRaw.

staticinflateRawSync(buf:EitherType<String, Buffer>, ?options:Null<ZlibOptions>):Buffer

Decompress a raw Buffer with InflateRaw (synchronous version).

staticinflateSync(buf:EitherType<String, Buffer>, ?options:Null<ZlibOptions>):Buffer

Decompress a raw Buffer with Inflate (synchronous version).

staticunzip(buf:EitherType<String, Buffer>, callback:(Error, Buffer) ‑> Void):Void

staticunzip(buf:EitherType<String, Buffer>, options:ZlibOptions, callback:(Error, Buffer) ‑> Void):Void

Decompress a raw Buffer with Unzip.

staticunzipSync(buf:EitherType<String, Buffer>, ?options:Null<ZlibOptions>):Buffer

Decompress a raw Buffer with Unzip (synchronous version).