Skip to content

Commit ff36f26

Browse files
committed
docs: add documentation for level option
1 parent 07f2396 commit ff36f26

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,30 @@ the response.
4646
The default filter function uses the [compressible](https://www.npmjs.com/package/compressible)
4747
module to determine if `res.getHeader('Content-Type')` is compressible.
4848

49+
##### level
50+
51+
The level of zlib compression to apply to responses. A higher level will result
52+
in better compression, but will take longer to complete. A lower level will
53+
result in less compression, but will be much faster.
54+
55+
This is an integer in the range of `0` (no compression) to `9` (maximum
56+
compression). The special value `-1` can be used to mean the "default
57+
compression level".
58+
59+
- `-1` Default compression level (also `zlib.Z_DEFAULT_COMPRESSION`).
60+
- `0` No compression (also `zlib.Z_NO_COMPRESSION`).
61+
- `1` Fastest compression (also `zlib.Z_BEST_SPEED`).
62+
- `2`
63+
- `3`
64+
- `4`
65+
- `5`
66+
- `6`
67+
- `7`
68+
- `8`
69+
- `9` Best compression (also `zlib.Z_BEST_COMPRESSION`).
70+
71+
**Note** in the list above, `zlib` is from `zlib = require('zlib')`.
72+
4973
##### threshold
5074

5175
The byte threshold for the response body size before compression is considered

0 commit comments

Comments
 (0)