Convenience methods
History
All of these take a Buffer, TypedArray, DataView, ArrayBuffer, or string
as the first argument, an optional second argument
to supply options to the zlib classes and will call the supplied callback
with callback(error, result).
Every method has a *Sync counterpart, which accept the same arguments, but
without a callback.
zlib.brotliCompress(buffer, options?, callback): void
zlib.brotliCompressSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringbrotli optionsCompress a chunk of data with BrotliCompress.
zlib.brotliDecompress(buffer, options?, callback): void
zlib.brotliDecompressSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringbrotli optionsDecompress a chunk of data with BrotliDecompress.
zlib.deflate(buffer, options?, callback): void
zlib.deflateSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringzlib optionsCompress a chunk of data with Deflate.
zlib.deflateRaw(buffer, options?, callback): void
zlib.deflateRawSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringzlib optionsCompress a chunk of data with DeflateRaw.
zlib.gunzip(buffer, options?, callback): void
zlib.gunzipSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringzlib optionsDecompress a chunk of data with Gunzip.
zlib.gzip(buffer, options?, callback): void
zlib.gzipSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringzlib optionsCompress a chunk of data with Gzip.
zlib.inflate(buffer, options?, callback): void
zlib.inflateSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringzlib optionsDecompress a chunk of data with Inflate.
zlib.inflateRaw(buffer, options?, callback): void
zlib.inflateRawSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringzlib optionsDecompress a chunk of data with InflateRaw.
zlib.unzip(buffer, options?, callback): void
zlib.unzipSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringzlib optionsDecompress a chunk of data with Unzip.
zlib.zstdCompress(buffer, options?, callback): void
zlib.zstdCompressSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringzstd optionsCompress a chunk of data with ZstdCompress.
zlib.zstdDecompress(buffer, options?, callback): void
zlib.zstdDecompressSync(buffer, options?): void
Buffer | TypedArray | DataView | ArrayBuffer | stringzstd optionsDecompress a chunk of data with ZstdDecompress.