类:BrotliOptions
¥Class: BrotliOptions
每个基于 Brotli 的类都有一个 options 对象。所有选项都是可选的。
¥Each Brotli-based class takes an options object. All options are optional.
- 
flush<integer> 默认值:zlib.constants.BROTLI_OPERATION_PROCESS¥ flush<integer> Default:zlib.constants.BROTLI_OPERATION_PROCESS
- 
finishFlush<integer> 默认值:zlib.constants.BROTLI_OPERATION_FINISH¥ finishFlush<integer> Default:zlib.constants.BROTLI_OPERATION_FINISH
- 
chunkSize<integer> 默认值:16 * 1024¥ chunkSize<integer> Default:16 * 1024
- 
params<Object> 包含索引 Brotli 参数 的键值对象。¥ params<Object> Key-value object containing indexed Brotli parameters.
- 
maxOutputLength<integer> 使用 方便的方法 时限制输出大小。默认值:buffer.kMaxLength¥ maxOutputLength<integer> Limits output size when using convenience methods. Default:buffer.kMaxLength
例如:
¥For example:
const stream = zlib.createBrotliCompress({
  chunkSize: 32 * 1024,
  params: {
    [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT,
    [zlib.constants.BROTLI_PARAM_QUALITY]: 4,
    [zlib.constants.BROTLI_PARAM_SIZE_HINT]: fs.statSync(inputFile).size,
  },
});