From bb9720c05f92099c25f1b36d67f81fbeb5db9093 Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Thu, 5 Nov 2015 10:40:47 -0500 Subject: [PATCH] doc: sort zlib alphabetically Reorders, with some contextual changes, the zlib documentation alphabetically. - Put Convenience Methods children under the Convenience Methods header - Renamed Options to Class Options and put above the Class definitions PR-URL: https://github.com/nodejs/node/pull/3662 Reviewed-By: Evan Lucas Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel --- doc/api/zlib.markdown | 311 +++++++++++++++++++++--------------------- 1 file changed, 158 insertions(+), 153 deletions(-) diff --git a/doc/api/zlib.markdown b/doc/api/zlib.markdown index 8ca7fbad2253e3..08f8fbdf7719e1 100644 --- a/doc/api/zlib.markdown +++ b/doc/api/zlib.markdown @@ -103,159 +103,6 @@ tradeoffs involved in zlib usage. } }).listen(1337); -## zlib.createGzip([options]) - -Returns a new [Gzip](#zlib_class_zlib_gzip) object with an -[options](#zlib_options). - -## zlib.createGunzip([options]) - -Returns a new [Gunzip](#zlib_class_zlib_gunzip) object with an -[options](#zlib_options). - -## zlib.createDeflate([options]) - -Returns a new [Deflate](#zlib_class_zlib_deflate) object with an -[options](#zlib_options). - -## zlib.createInflate([options]) - -Returns a new [Inflate](#zlib_class_zlib_inflate) object with an -[options](#zlib_options). - -## zlib.createDeflateRaw([options]) - -Returns a new [DeflateRaw](#zlib_class_zlib_deflateraw) object with an -[options](#zlib_options). - -## zlib.createInflateRaw([options]) - -Returns a new [InflateRaw](#zlib_class_zlib_inflateraw) object with an -[options](#zlib_options). - -## zlib.createUnzip([options]) - -Returns a new [Unzip](#zlib_class_zlib_unzip) object with an -[options](#zlib_options). - - -## 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`. - -Flush pending data. Don't call this frivolously, premature flushes negatively -impact the effectiveness of the compression algorithm. - -### 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. - -## Class: zlib.Gzip - -Compress data using gzip. - -## Class: zlib.Gunzip - -Decompress a gzip stream. - -## Class: zlib.Deflate - -Compress data using deflate. - -## Class: zlib.Inflate - -Decompress a deflate stream. - -## Class: zlib.DeflateRaw - -Compress data using deflate, and do not append a zlib header. - -## Class: zlib.InflateRaw - -Decompress a raw deflate stream. - -## Class: zlib.Unzip - -Decompress either a Gzip- or Deflate-compressed stream by auto-detecting -the header. - -## Convenience Methods - - - -All of these take a string or buffer 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.deflate(buf[, options], callback) -## zlib.deflateSync(buf[, options]) - -Compress a string with Deflate. - -## zlib.deflateRaw(buf[, options], callback) -## zlib.deflateRawSync(buf[, options]) - -Compress a string with DeflateRaw. - -## zlib.gzip(buf[, options], callback) -## zlib.gzipSync(buf[, options]) - -Compress a string with Gzip. - -## zlib.gunzip(buf[, options], callback) -## zlib.gunzipSync(buf[, options]) - -Decompress a raw Buffer with Gunzip. - -## zlib.inflate(buf[, options], callback) -## zlib.inflateSync(buf[, options]) - -Decompress a raw Buffer with Inflate. - -## zlib.inflateRaw(buf[, options], callback) -## zlib.inflateRawSync(buf[, options]) - -Decompress a raw Buffer with InflateRaw. - -## zlib.unzip(buf[, options], callback) -## zlib.unzipSync(buf[, options]) - -Decompress a raw Buffer with Unzip. - -## Options - - - -Each class takes an options object. All options are optional. - -Note that some options are only relevant when compressing, and are -ignored by the decompression classes. - -* flush (default: `zlib.Z_NO_FLUSH`) -* chunkSize (default: 16*1024) -* windowBits -* level (compression only) -* memLevel (compression only) -* strategy (compression only) -* dictionary (deflate/inflate only, empty dictionary by default) - -See the description of `deflateInit2` and `inflateInit2` at - for more information on these. - ## Memory Usage Tuning @@ -361,3 +208,161 @@ The deflate compression method (the only one supported in this version). For initializing zalloc, zfree, opaque. * `zlib.Z_NULL` + +## Class Options + + + +Each class takes an options object. All options are optional. + +Note that some options are only relevant when compressing, and are +ignored by the decompression classes. + +* flush (default: `zlib.Z_NO_FLUSH`) +* chunkSize (default: 16*1024) +* windowBits +* level (compression only) +* memLevel (compression only) +* strategy (compression only) +* dictionary (deflate/inflate only, empty dictionary by default) + +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`. + +Flush pending data. Don't call this frivolously, premature flushes negatively +impact the effectiveness of the compression algorithm. + +### 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](#zlib_class_zlib_deflate) object with an +[options](#zlib_options). + +## zlib.createDeflateRaw([options]) + +Returns a new [DeflateRaw](#zlib_class_zlib_deflateraw) object with an +[options](#zlib_options). + +## zlib.createGunzip([options]) + +Returns a new [Gunzip](#zlib_class_zlib_gunzip) object with an +[options](#zlib_options). + +## zlib.createGzip([options]) + +Returns a new [Gzip](#zlib_class_zlib_gzip) object with an +[options](#zlib_options). + +## zlib.createInflate([options]) + +Returns a new [Inflate](#zlib_class_zlib_inflate) object with an +[options](#zlib_options). + +## zlib.createInflateRaw([options]) + +Returns a new [InflateRaw](#zlib_class_zlib_inflateraw) object with an +[options](#zlib_options). + +## zlib.createUnzip([options]) + +Returns a new [Unzip](#zlib_class_zlib_unzip) object with an +[options](#zlib_options). + +## Convenience Methods + + + +All of these take a string or buffer 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.deflate(buf[, options], callback) + +Compress a string with Deflate. + +### zlib.deflateRaw(buf[, options], callback) +### zlib.deflateRawSync(buf[, options]) + +Compress a string with DeflateRaw. + +### zlib.deflateSync(buf[, options]) + +Compress a string with Deflate. + +### zlib.gunzip(buf[, options], callback) +### zlib.gunzipSync(buf[, options]) + +Decompress a raw Buffer with Gunzip. + +### zlib.gzip(buf[, options], callback) +### zlib.gzipSync(buf[, options]) + +Compress a string with Gzip. + +### zlib.inflate(buf[, options], callback) + +Decompress a raw Buffer with Inflate. + +### zlib.inflateRaw(buf[, options], callback) +### zlib.inflateRawSync(buf[, options]) + +Decompress a raw Buffer with InflateRaw. + +### zlib.inflateSync(buf[, options]) + +Decompress a raw Buffer with Inflate. + +### zlib.unzip(buf[, options], callback) +### zlib.unzipSync(buf[, options]) + +Decompress a raw Buffer with Unzip.