ZstdOptions
History
Added in: v23.8.0, v22.15.0
v23.8.0, v22.15.0
Introduced in: v0.10.0
v0.10.0
The
dictionary option can be a TypedArray, DataView, or ArrayBuffer.v26.7.0
The
rejectGarbageAfterEnd option was added.v26.5.0
Stability: 1Experimental
Each Zstd-based class takes an options object. All options are optional.
Attributes
flush?:
integerDefault:
zlib.constants.ZSTD_e_continuefinishFlush?:
integerDefault:
zlib.constants.ZSTD_e_endchunkSize?:
integerDefault:
16 * 1024params:
ObjectKey-value object containing indexed Zstd parameters.
maxOutputLength?:
integerLimits output size when using
convenience methods. Default:
buffer.kMaxLengthinfo?:
booleanIf
true, returns an object with buffer and engine. Default: falsedictionary:
Buffer | TypedArray | DataView | ArrayBufferOptional dictionary used
to improve compression efficiency when compressing or decompressing data that
shares common patterns with the dictionary.
rejectGarbageAfterEnd?:
booleanIf
true, decompression fails when
input remains after the first complete compressed stream. Default: falseFor example:
const stream = zlib.createZstdCompress({ chunkSize: 32 * 1024, params: { [zlib.constants.ZSTD_c_compressionLevel]: 10, [zlib.constants.ZSTD_c_checksumFlag]: 1, }, });