Zlib
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: IntAllowed flush values.
Z_PARTIAL_FLUSH: IntZ_SYNC_FLUSH: IntZ_FULL_FLUSH: IntZ_FINISH: IntZ_BLOCK: IntZ_TREES: IntZ_OK: IntReturn codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events.
Z_STREAM_END: IntZ_NEED_DICT: IntZ_ERRNO: IntZ_STREAM_ERROR: IntZ_DATA_ERROR: IntZ_MEM_ERROR: IntZ_BUF_ERROR: IntZ_VERSION_ERROR: IntZ_NO_COMPRESSION: IntCompression levels.
Z_BEST_SPEED: IntZ_BEST_COMPRESSION: IntZ_DEFAULT_COMPRESSION: IntZ_FILTERED: IntCompression strategy.
Z_HUFFMAN_ONLY: IntZ_RLE: IntZ_FIXED: IntZ_DEFAULT_STRATEGY: IntZ_BINARY: IntPossible values of the data_type field.
Z_TEXT: IntZ_ASCII: IntZ_UNKNOWN: IntZ_DEFLATED: IntThe deflate compression method (the only one supported in this version).
Z_NULL: IntFor initializing zalloc, zfree, opaque.
createGzip(?options: Null<ZlibOptions>): js.node.zlib.GzipReturns 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.GunzipReturns 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.DeflateReturns 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.InflateReturns 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.DeflateRawReturns 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.InflateRawReturns 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.UnzipReturns 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): VoidCompress a string with Deflate.
| Name | Type |
|---|---|
buf |
haxe.extern.EitherType<String, Buffer> |
callback |
Function |
deflateSync(buf: haxe.extern.EitherType<String, Buffer>, ?options: Null<ZlibOptions>): BufferCompress 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): VoidCompress a string with DeflateRaw.
| Name | Type |
|---|---|
buf |
haxe.extern.EitherType<String, Buffer> |
callback |
Function |
deflateRawSync(buf: haxe.extern.EitherType<String, Buffer>, ?options: Null<ZlibOptions>): BufferCompress 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): VoidCompress a string with Gzip.
| Name | Type |
|---|---|
buf |
haxe.extern.EitherType<String, Buffer> |
callback |
Function |
gzipSync(buf: haxe.extern.EitherType<String, Buffer>, ?options: Null<ZlibOptions>): BufferCompress 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): VoidDecompress a raw Buffer with Gunzip.
| Name | Type |
|---|---|
buf |
haxe.extern.EitherType<String, Buffer> |
callback |
Function |
gunzipSync(buf: haxe.extern.EitherType<String, Buffer>, ?options: Null<ZlibOptions>): BufferDecompress 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): VoidDecompress 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>): BufferDecompress 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): VoidDecompress 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>): BufferDecompress 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): VoidDecompress a raw Buffer with Unzip.
| Name | Type |
|---|---|
buf |
haxe.extern.EitherType<String, Buffer> |
callback |
Function |
unzipSync(buf: haxe.extern.EitherType<String, Buffer>, ?options: Null<ZlibOptions>): BufferDecompress 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" |