Skip to content

Commit e6a6cdb

Browse files
Annaicktargos
authored andcommitted
doc: add missing Zstd strategy constants
PR-URL: #59312 Fixes: #59290 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 3109297 commit e6a6cdb

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

doc/api/zlib.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,34 @@ The most important options are:
750750
* `ZSTD_c_compressionLevel`
751751
* Set compression parameters according to pre-defined cLevel table. Default
752752
level is ZSTD\_CLEVEL\_DEFAULT==3.
753+
* `ZSTD_c_strategy`
754+
* Select the compression strategy.
755+
* Possible values are listed in the strategy options section below.
756+
757+
#### Strategy options
758+
759+
The following constants can be used as values for the `ZSTD_c_strategy`
760+
parameter:
761+
762+
* `zlib.constants.ZSTD_fast`
763+
* `zlib.constants.ZSTD_dfast`
764+
* `zlib.constants.ZSTD_greedy`
765+
* `zlib.constants.ZSTD_lazy`
766+
* `zlib.constants.ZSTD_lazy2`
767+
* `zlib.constants.ZSTD_btlazy2`
768+
* `zlib.constants.ZSTD_btopt`
769+
* `zlib.constants.ZSTD_btultra`
770+
* `zlib.constants.ZSTD_btultra2`
771+
772+
Example:
773+
774+
```js
775+
const stream = zlib.createZstdCompress({
776+
params: {
777+
[zlib.constants.ZSTD_c_strategy]: zlib.constants.ZSTD_btultra,
778+
},
779+
});
780+
```
753781

754782
#### Pledged Source Size
755783

0 commit comments

Comments
 (0)