diff --git a/doc/api/zlib.md b/doc/api/zlib.md index 7de4fc80e779be..3728015fc4327b 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -215,6 +215,9 @@ http.createServer((request, response) => { ``` ## Constants + @@ -279,6 +282,9 @@ For initializing zalloc, zfree, opaque. * `zlib.Z_NULL` ## Class Options + @@ -300,40 +306,67 @@ See the description of `deflateInit2` and `inflateInit2` at for more information on these. ## Class: zlib.Deflate + Compress data using deflate. ## Class: zlib.DeflateRaw + Compress data using deflate, and do not append a `zlib` header. ## Class: zlib.Gunzip + Decompress a gzip stream. ## Class: zlib.Gzip + Compress data using gzip. ## Class: zlib.Inflate + Decompress a deflate stream. ## Class: zlib.InflateRaw + Decompress a raw deflate stream. ## Class: zlib.Unzip + Decompress either a Gzip- or Deflate-compressed stream by auto-detecting the header. ## Class: zlib.Zlib + Not exported by the `zlib` module. It is documented here because it is the base class of the compressor/decompressor classes. ### zlib.flush([kind], callback) + `kind` defaults to `zlib.Z_FULL_FLUSH`. @@ -346,40 +379,67 @@ 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) + 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.createDeflate([options]) + Returns a new [Deflate][] object with an [options][]. ## zlib.createDeflateRaw([options]) + Returns a new [DeflateRaw][] object with an [options][]. ## zlib.createGunzip([options]) + Returns a new [Gunzip][] object with an [options][]. ## zlib.createGzip([options]) + Returns a new [Gzip][] object with an [options][]. ## zlib.createInflate([options]) + Returns a new [Inflate][] object with an [options][]. ## zlib.createInflateRaw([options]) + Returns a new [InflateRaw][] object with an [options][]. ## zlib.createUnzip([options]) + Returns a new [Unzip][] object with an [options][]. @@ -395,37 +455,79 @@ Every method has a `*Sync` counterpart, which accept the same arguments, but without a callback. ### zlib.deflate(buf[, options], callback) + ### zlib.deflateSync(buf[, options]) + Compress a Buffer or string with Deflate. ### zlib.deflateRaw(buf[, options], callback) + ### zlib.deflateRawSync(buf[, options]) + Compress a Buffer or string with DeflateRaw. ### zlib.gunzip(buf[, options], callback) + ### zlib.gunzipSync(buf[, options]) + Decompress a Buffer or string with Gunzip. ### zlib.gzip(buf[, options], callback) + ### zlib.gzipSync(buf[, options]) + Compress a Buffer or string with Gzip. ### zlib.inflate(buf[, options], callback) + ### zlib.inflateSync(buf[, options]) + Decompress a Buffer or string with Inflate. ### zlib.inflateRaw(buf[, options], callback) + ### zlib.inflateRawSync(buf[, options]) + Decompress a Buffer or string with InflateRaw. ### zlib.unzip(buf[, options], callback) + ### zlib.unzipSync(buf[, options]) + Decompress a Buffer or string with Unzip.