diff --git a/doc/api/zlib.md b/doc/api/zlib.md index 36977eae86af6f..0db5a9ade6b06f 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -696,7 +696,67 @@ The `zlib.bytesWritten` property specifies the number of bytes written to the engine, before the bytes are processed (compressed or decompressed, as appropriate for the derived class). -### `zlib.crc32(data[, value])` +### `zlib.close([callback])` + + + +* `callback` {Function} + +Close the underlying handle. + +### `zlib.flush([kind, ]callback)` + + + +* `kind` **Default:** `zlib.constants.Z_FULL_FLUSH` for zlib-based streams, + `zlib.constants.BROTLI_OPERATION_FLUSH` for Brotli-based streams. +* `callback` {Function} + +Flush pending data. Don't call this frivolously, premature flushes negatively +impact the effectiveness of the compression algorithm. + +Calling this only flushes data from the internal `zlib` state, and does not +perform flushing of any kind on the streams level. Rather, it behaves like a +normal call to `.write()`, i.e. it will be queued up behind other pending +writes and will only produce output when data is being read from the stream. + +### `zlib.params(level, strategy, callback)` + + + +* `level` {integer} +* `strategy` {integer} +* `callback` {Function} + +This function is only available for zlib-based streams, i.e. not Brotli. + +Dynamically update the compression level and compression strategy. +Only applicable to deflate algorithm. + +### `zlib.reset()` + + + +Reset the compressor/decompressor to factory defaults. Only applicable to +the inflate and deflate algorithms. + +## `zlib.constants` + + + +Provides an object enumerating Zlib-related constants. + +## `zlib.crc32(data[, value])` - -* `callback` {Function} - -Close the underlying handle. - -### `zlib.flush([kind, ]callback)` - - - -* `kind` **Default:** `zlib.constants.Z_FULL_FLUSH` for zlib-based streams, - `zlib.constants.BROTLI_OPERATION_FLUSH` for Brotli-based streams. -* `callback` {Function} - -Flush pending data. Don't call this frivolously, premature flushes negatively -impact the effectiveness of the compression algorithm. - -Calling this only flushes data from the internal `zlib` state, and does not -perform flushing of any kind on the streams level. Rather, it behaves like a -normal call to `.write()`, i.e. it will be queued up behind other pending -writes and will only produce output when data is being read from the stream. - -### `zlib.params(level, strategy, callback)` - - - -* `level` {integer} -* `strategy` {integer} -* `callback` {Function} - -This function is only available for zlib-based streams, i.e. not Brotli. - -Dynamically update the compression level and compression strategy. -Only applicable to deflate algorithm. - -### `zlib.reset()` - - - -Reset the compressor/decompressor to factory defaults. Only applicable to -the inflate and deflate algorithms. - -## `zlib.constants` - - - -Provides an object enumerating Zlib-related constants. - ## `zlib.createBrotliCompress([options])`