doc: add missing Zstd strategy constants

PR-URL: https://github.com/nodejs/node/pull/59312
Fixes: https://github.com/nodejs/node/issues/59290
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
RANDRIAMANANTENA Narindra Tiana Annaick 2025-08-19 21:38:44 +03:00 committed by GitHub
parent 3755e8b144
commit ef58be6f0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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.
* 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