类:Options


🌐 Class: Options

每个基于 zlib 的类都接受一个 options 对象。无需提供选项。

🌐 Each zlib-based class takes an options object. No options are required.

有些选项仅在压缩时相关,解压类会忽略这些选项。

🌐 Some options are only relevant when compressing and are ignored by the decompression classes.

  • flush <integer> 默认: zlib.constants.Z_NO_FLUSH
  • finishFlush <integer> 默认: zlib.constants.Z_FINISH
  • chunkSize <integer> 默认: 16 * 1024
  • windowBits <integer>
  • level <integer> (仅限压缩)
  • memLevel <integer> (仅限压缩)
  • strategy <integer> (仅限压缩)
  • dictionary <Buffer> | <TypedArray> | <DataView> | <ArrayBuffer> (仅限压缩/解压缩,默认使用空字典)
  • info <boolean> (如果 true,则返回包含 bufferengine 的对象。)
  • maxOutputLength <integer> 在使用 便捷方法 时限制输出大小。默认值: buffer.kMaxLength
  • rejectGarbageAfterEnd <boolean> 如果 true,当在压缩流结束后检测到多余输入时,解压会失败。这包括无法读取的字节,以及在解压 gzip 时,第一个成员之后的额外 gzip 成员。默认值: false

查看更多信息,请参阅 deflateInit2inflateInit2 文档。

🌐 See the deflateInit2 and inflateInit2 documentation for more information.