Skip to content

Expand documentation for Zstd strategy parameter (ZSTD_c_strategy) and constants in node:zlib #59290

@lluisemper

Description

@lluisemper

Affected URL(s)

https://nodejs.org/api/zlib.html

Description of the problem

Node.js internally supports the Zstandard compression parameter ZSTD_c_strategy and exposes related constants (such as ZSTD_fast, ZSTD_btultra, etc.) via zlib.constants. However, these are not currently documented in the nodejs API documentation for the zlib module.

While zstd support is currently marked as experimental, documenting these parameters and constants would make it easier for developers to explore and use the feature.

Also, adding an example of using such a feature would be beneficial:

const compressed = zlib.zstdCompress(input, {
  params: {
    [zlib.constants.ZSTD_c_strategy]: zlib.constants.ZSTD_btultra,
  }
},() => ....);

Documenting these constants and parameters would align with other existing documented Zstd options (e.g., ZSTD_c_compressionLevel) and improve developer experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions