From 52aeb4d606d59f92167ef990a4603285f08b9dfb Mon Sep 17 00:00:00 2001 From: annaick Date: Fri, 1 Aug 2025 13:22:51 +0300 Subject: [PATCH 1/2] doc: add missing Zstd strategy constants --- doc/api/zlib.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/api/zlib.md b/doc/api/zlib.md index 78330445a846ca..e15719011b16ab 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -750,6 +750,34 @@ The most important options are: * `ZSTD_c_compressionLevel` * Set compression parameters according to pre-defined cLevel table. Default level is ZSTD\_CLEVEL\_DEFAULT==3. +* `ZSTD_c_strategy` + * Select the compression strategy. Default is `ZSTD_lazy2`. + * Possible values are listed in the strategy options section below. + +#### Strategy options + +The following constants can be used as values for the `ZSTD_c_strategy` +parameter: + +* `zlib.constants.ZSTD_fast` +* `zlib.constants.ZSTD_dfast` +* `zlib.constants.ZSTD_greedy` +* `zlib.constants.ZSTD_lazy` +* `zlib.constants.ZSTD_lazy2` +* `zlib.constants.ZSTD_btlazy2` +* `zlib.constants.ZSTD_btopt` +* `zlib.constants.ZSTD_btultra` +* `zlib.constants.ZSTD_btultra2` + +Example: + +```js +const stream = zlib.createZstdCompress({ + params: { + [zlib.constants.ZSTD_c_strategy]: zlib.constants.ZSTD_btultra, + }, +}); +``` #### Pledged Source Size From 4653cd4391022f8f482063c657fc15ada5a894e5 Mon Sep 17 00:00:00 2001 From: annaick Date: Sat, 2 Aug 2025 06:30:18 +0300 Subject: [PATCH 2/2] doc: omited default strategy for zstd_c_strategy --- doc/api/zlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/zlib.md b/doc/api/zlib.md index e15719011b16ab..5d8fd2ecb8b55d 100644 --- a/doc/api/zlib.md +++ b/doc/api/zlib.md @@ -751,7 +751,7 @@ The most important options are: * Set compression parameters according to pre-defined cLevel table. Default level is ZSTD\_CLEVEL\_DEFAULT==3. * `ZSTD_c_strategy` - * Select the compression strategy. Default is `ZSTD_lazy2`. + * Select the compression strategy. * Possible values are listed in the strategy options section below. #### Strategy options