Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit adf98f6

Browse filesBrowse files
Annaickrichardlau
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 fd02295 commit adf98f6
Copy full SHA for adf98f6

File tree

Expand file treeCollapse file tree

1 file changed

+28
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+28
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/zlib.md‎

Copy file name to clipboardExpand all lines: doc/api/zlib.md
+28Lines changed: 28 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.