Zlib

js.node.Zlib (extern class)

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 Members

Z_NO_FLUSH: Int

Allowed flush values.


Z_PARTIAL_FLUSH: Int

Z_SYNC_FLUSH: Int

Z_FULL_FLUSH: Int

Z_FINISH: Int

Z_BLOCK: Int

Z_TREES: Int

Z_OK: Int

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


Z_STREAM_END: Int

Z_NEED_DICT: Int

Z_ERRNO: Int

Z_STREAM_ERROR: Int

Z_DATA_ERROR: Int

Z_MEM_ERROR: Int

Z_BUF_ERROR: Int

Z_VERSION_ERROR: Int

Z_NO_COMPRESSION: Int

Compression levels.


Z_BEST_SPEED: Int

Z_BEST_COMPRESSION: Int

Z_DEFAULT_COMPRESSION: Int

Z_FILTERED: Int

Compression strategy.


Z_HUFFMAN_ONLY: Int

Z_RLE: Int

Z_FIXED: Int

Z_DEFAULT_STRATEGY: Int

Z_BINARY: Int

Possible values of the data_type field.


Z_TEXT: Int

Z_ASCII: Int

Z_UNKNOWN: Int

Z_DEFLATED: Int

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


Z_NULL: Int

For initializing zalloc, zfree, opaque.


createGzip(?options: Null<ZlibOptions>): js.node.zlib.Gzip

Returns a new Gzip object with an options.

Name Type Default
options Null<ZlibOptions> (optional)
Returns
js.node.zlib.Gzip

createGunzip(?options: Null<ZlibOptions>): js.node.zlib.Gunzip

Returns a new Gunzip object with an options.

Name Type Default
options Null<ZlibOptions> (optional)
Returns
js.node.zlib.Gunzip

createDeflate(?options: Null<ZlibOptions>): js.node.zlib.Deflate

Returns a new Deflate object with an options.

Name Type Default
options Null<ZlibOptions> (optional)
Returns
js.node.zlib.Deflate

createInflate(?options: Null<ZlibOptions>): js.node.zlib.Inflate

Returns a new Inflate object with an options.

Name Type Default
options Null<ZlibOptions> (optional)
Returns
js.node.zlib.Inflate

createDeflateRaw(?options: Null<ZlibOptions>): js.node.zlib.DeflateRaw

Returns a new DeflateRaw object with an options.

Name Type Default
options Null<ZlibOptions> (optional)
Returns
js.node.zlib.DeflateRaw

createInflateRaw(?options: Null<ZlibOptions>): js.node.zlib.InflateRaw

Returns a new InflateRaw object with an options.

Name Type Default
options Null<ZlibOptions> (optional)
Returns
js.node.zlib.InflateRaw

createUnzip(?options: Null<ZlibOptions>): js.node.zlib.Unzip

Returns a new Unzip object with an options.

Name Type Default
options Null<ZlibOptions> (optional)
Returns
js.node.zlib.Unzip

deflate(buf: haxe.extern.EitherType<String, Buffer>, callback: Function): Void

Compress a string with Deflate.

Name Type
buf haxe.extern.EitherType<String, Buffer>
callback Function

deflateSync(buf: haxe.extern.EitherType<String, Buffer>, ?options: Null<ZlibOptions>): Buffer

Compress a string with Deflate (synchronous version).

Name Type Default
buf haxe.extern.EitherType<String, Buffer>
options Null<ZlibOptions> (optional)
Returns
Buffer

deflateRaw(buf: haxe.extern.EitherType<String, Buffer>, callback: Function): Void

Compress a string with DeflateRaw.

Name Type
buf haxe.extern.EitherType<String, Buffer>
callback Function

deflateRawSync(buf: haxe.extern.EitherType<String, Buffer>, ?options: Null<ZlibOptions>): Buffer

Compress a string with DeflateRaw (synchronous version).

Name Type Default
buf haxe.extern.EitherType<String, Buffer>
options Null<ZlibOptions> (optional)
Returns
Buffer

gzip(buf: haxe.extern.EitherType<String, Buffer>, callback: Function): Void

Compress a string with Gzip.

Name Type
buf haxe.extern.EitherType<String, Buffer>
callback Function

Compress a string with Gzip (synchronous version).

Name Type Default
buf haxe.extern.EitherType<String, Buffer>
options Null<ZlibOptions> (optional)
Returns
Buffer

gunzip(buf: haxe.extern.EitherType<String, Buffer>, callback: Function): Void

Decompress a raw Buffer with Gunzip.

Name Type
buf haxe.extern.EitherType<String, Buffer>
callback Function

Decompress a raw Buffer with Gunzip (synchronous version).

Name Type Default
buf haxe.extern.EitherType<String, Buffer>
options Null<ZlibOptions> (optional)
Returns
Buffer

inflate(buf: haxe.extern.EitherType<String, Buffer>, callback: Function): Void

Decompress a raw Buffer with Inflate.

Name Type
buf haxe.extern.EitherType<String, Buffer>
callback Function

inflateSync(buf: haxe.extern.EitherType<String, Buffer>, ?options: Null<ZlibOptions>): Buffer

Decompress a raw Buffer with Inflate (synchronous version).

Name Type Default
buf haxe.extern.EitherType<String, Buffer>
options Null<ZlibOptions> (optional)
Returns
Buffer

inflateRaw(buf: haxe.extern.EitherType<String, Buffer>, callback: Function): Void

Decompress a raw Buffer with InflateRaw.

Name Type
buf haxe.extern.EitherType<String, Buffer>
callback Function

inflateRawSync(buf: haxe.extern.EitherType<String, Buffer>, ?options: Null<ZlibOptions>): Buffer

Decompress a raw Buffer with InflateRaw (synchronous version).

Name Type Default
buf haxe.extern.EitherType<String, Buffer>
options Null<ZlibOptions> (optional)
Returns
Buffer

unzip(buf: haxe.extern.EitherType<String, Buffer>, callback: Function): Void

Decompress a raw Buffer with Unzip.

Name Type
buf haxe.extern.EitherType<String, Buffer>
callback Function

Decompress a raw Buffer with Unzip (synchronous version).

Name Type Default
buf haxe.extern.EitherType<String, Buffer>
options Null<ZlibOptions> (optional)
Returns
Buffer

Metadata

Name Parameters
:jsRequire "zlib"