Skip to content

Commit adf98f6

Browse files
Annaickrichardlau
authored andcommitted
doc: add missing Zstd strategy constants
PR-URL: #59312 Fixes: #59290 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent fd02295 commit adf98f6

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
@@ -748,6 +748,34 @@ The most important options are:
748748
* `ZSTD_c_compressionLevel`
749749
* Set compression parameters according to pre-defined cLevel table. Default
750750
level is ZSTD\_CLEVEL\_DEFAULT==3.
751+
* `ZSTD_c_strategy`
752+
* Select the compression strategy.
753+
* Possible values are listed in the strategy options section below.
754+
755+
#### Strategy options
756+
757+
The following constants can be used as values for the `ZSTD_c_strategy`
758+
parameter:
759+
760+
* `zlib.constants.ZSTD_fast`
761+
* `zlib.constants.ZSTD_dfast`
762+
* `zlib.constants.ZSTD_greedy`
763+
* `zlib.constants.ZSTD_lazy`
764+
* `zlib.constants.ZSTD_lazy2`
765+
* `zlib.constants.ZSTD_btlazy2`
766+
* `zlib.constants.ZSTD_btopt`
767+
* `zlib.constants.ZSTD_btultra`
768+
* `zlib.constants.ZSTD_btultra2`
769+
770+
Example:
771+
772+
```js
773+
const stream = zlib.createZstdCompress({
774+
params: {
775+
[zlib.constants.ZSTD_c_strategy]: zlib.constants.ZSTD_btultra,
776+
},
777+
});
778+
```
751779

752780
#### Pledged Source Size
753781

0 commit comments

Comments
 (0)