zlib.ZlibBase
History
Zlib to ZlibBase.class zlib.ZlibBase extends undefined
Not exported by the node:zlib module. It is documented here because it is the
base class of the compressor/decompressor classes.
This class inherits from stream.Transform, allowing node:zlib objects to
be used in pipes and similar stream operations.
numberThe 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.close(callback?): void
FunctionClose the underlying handle.
zlib.flush(kind?, callback): void
kindDefault:zlib.constants.Z_FULL_FLUSHfor zlib-based streams,zlib.constants.BROTLI_OPERATION_FLUSHfor Brotli-based streams.callbackFunction
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): void
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(): void
Reset the compressor/decompressor to factory defaults. Only applicable to the inflate and deflate algorithms.