diff options
author | Florian Dold <florian@dold.me> | 2021-08-20 13:31:03 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-08-20 13:31:03 +0200 |
commit | 859a8734c87d5e5081d7b0aa02cb538a7c801eac (patch) | |
tree | d2e9163479eb56ec382c842d62ce39fe30d450a4 /docs/interfaces/zliboptions.md | |
download | node-vendor-859a8734c87d5e5081d7b0aa02cb538a7c801eac.tar.gz node-vendor-859a8734c87d5e5081d7b0aa02cb538a7c801eac.tar.bz2 node-vendor-859a8734c87d5e5081d7b0aa02cb538a7c801eac.zip |
Squashed 'fflate/' content from commit b786929
git-subtree-dir: fflate
git-subtree-split: b786929a368521e9cfcdcf7490a8e77485d5a253
Diffstat (limited to 'docs/interfaces/zliboptions.md')
-rw-r--r-- | docs/interfaces/zliboptions.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/interfaces/zliboptions.md b/docs/interfaces/zliboptions.md new file mode 100644 index 0000000..338b1a0 --- /dev/null +++ b/docs/interfaces/zliboptions.md @@ -0,0 +1,56 @@ +# Interface: ZlibOptions + +Options for compressing data into a Zlib format + +## Hierarchy + +* [DeflateOptions](deflateoptions.md) + + ↳ **ZlibOptions** + + ↳↳ [AsyncZlibOptions](asynczliboptions.md) + +## Index + +### Properties + +* [level](zliboptions.md#level) +* [mem](zliboptions.md#mem) + +## Properties + +### level + +• `Optional` **level**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 + +*Inherited from [DeflateOptions](deflateoptions.md).[level](deflateoptions.md#level)* + +The level of compression to use, ranging from 0-9. + +0 will store the data without compression. +1 is fastest but compresses the worst, 9 is slowest but compresses the best. +The default level is 6. + +Typically, binary data benefits much more from higher values than text data. +In both cases, higher values usually take disproportionately longer than the reduction in final size that results. + +For example, a 1 MB text file could: +- become 1.01 MB with level 0 in 1ms +- become 400 kB with level 1 in 10ms +- become 320 kB with level 9 in 100ms + +___ + +### mem + +• `Optional` **mem**: 0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 + +*Inherited from [DeflateOptions](deflateoptions.md).[mem](deflateoptions.md#mem)* + +The memory level to use, ranging from 0-12. Increasing this increases speed and compression ratio at the cost of memory. + +Note that this is exponential: while level 0 uses 4 kB, level 4 uses 64 kB, level 8 uses 1 MB, and level 12 uses 16 MB. +It is recommended not to lower the value below 4, since that tends to hurt performance. +In addition, values above 8 tend to help very little on most data and can even hurt performance. + +The default value is automatically determined based on the size of the input data. |