Skip to content

Incorrect Brotli example #154

@matthewdouglas

Description

@matthewdouglas

Documentation Is:

  • Missing
  • Needed
  • Confusing
  • Not Sure?

Please Explain in Detail...

The Brotli examples in the README do not correctly set the compressionOptions. The BROTLI_PARAM_QUALITY parameter is the equivalent to zlib's level option in terms of functionality, but not naming.

Your Proposal for Changes

  1. Revise the examples to set the Brotli parameters correctly.
const zlib = require('zlib');
...
compressionOptions: {
  params: {
    [zlib.constants.BROTLI_PARAM_QUALITY]: 11
  }
}
  1. Update the note to be more clear about BROTLI_PARAM_QUALITY being functionally equivalent to level, but not syntactically.

  2. Update note regarding Node version as Brotli native support was backported to Node 10.16.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions