Options
History
Added in: v0.11.1
v0.11.1
Introduced in: v0.10.0
v0.10.0
The
rejectGarbageAfterEnd option was added.v26.5.0
The
maxOutputLength option is supported now.v14.5.0, v12.19.0
The
dictionary option can be an ArrayBuffer.v9.4.0
The
dictionary option can be an Uint8Array now.v8.0.0
The
finishFlush option is supported now.v5.11.0
Each zlib-based class takes an options object. No options are required.
Some options are only relevant when compressing and are ignored by the decompression classes.
Attributes
flush?:
integerDefault:
zlib.constants.Z_NO_FLUSHfinishFlush?:
integerDefault:
zlib.constants.Z_FINISHchunkSize?:
integerDefault:
16 * 1024windowBits:
integerlevel:
integer(compression only)
memLevel:
integer(compression only)
strategy:
integer(compression only)
dictionary:
Buffer | TypedArray | DataView | ArrayBuffer(deflate/inflate only,
empty dictionary by default)
info:
boolean(If
true, returns an object with buffer and engine.)maxOutputLength?:
integerLimits output size when using
convenience methods. Default:
buffer.kMaxLengthrejectGarbageAfterEnd?:
booleanIf
true, decompression fails when
trailing input is detected after the end of the compressed stream. This
includes unreadable bytes and, when decompressing gzip, additional gzip
members following the first member. Default: falseSee the deflateInit2 and inflateInit2 documentation for more
information.