diff --git a/doc/api/zlib.md b/doc/api/zlib.md index 9ab581678e0..a8360825c9b 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -2158,7 +2158,8 @@ added: v0.5.8 --> * `kind` **Default:** `zlib.constants.Z_FULL_FLUSH` for zlib-based streams, - `zlib.constants.BROTLI_OPERATION_FLUSH` for Brotli-based streams. + `zlib.constants.BROTLI_OPERATION_FLUSH` for Brotli-based streams, and + `zlib.constants.ZSTD_e_flush` for Zstd-based streams. * `callback` {Function} Flush pending data. Don't call this frivolously, premature flushes negatively @@ -2190,8 +2191,14 @@ Only applicable to deflate algorithm. added: v0.7.0 --> -Reset the compressor/decompressor to factory defaults. Only applicable to -the inflate and deflate algorithms. +For inflate and deflate streams, reset the compressor/decompressor to factory +defaults. + +For Zstd streams, cancel the current frame and start a new session while +preserving the configured parameters and dictionary. If `pledgedSrcSize` was +configured for a Zstd compressor, it applies again to the next frame. + +Calling `reset()` while a write is in progress throws an `Error`. ## Class: `ZstdOptions` @@ -2223,6 +2230,9 @@ Each Zstd-based class takes an `options` object. All options are optional. * `finishFlush` {integer} **Default:** `zlib.constants.ZSTD_e_end` * `chunkSize` {integer} **Default:** `16 * 1024` * `params` {Object} Key-value object containing indexed [Zstd parameters][]. +* `pledgedSrcSize` {number} Expected total size of the uncompressed input. It + must be a non-negative safe integer and must match the input size when + compression finishes. Only applicable to Zstd compressors. * `maxOutputLength` {integer} Limits output size when using [convenience methods][]. **Default:** [`buffer.kMaxLength`][] * `info` {boolean} If `true`, returns an object with `buffer` and `engine`. **Default:** `false` @@ -3062,6 +3072,8 @@ Compress a chunk of data with [`ZstdCompress`][]. ### `zlib.zstdDecompress(buffer[, options], callback)` +> Stability: 1 - Experimental +