You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,20 @@ Each method accepts a buffer and returns a promise for a buffer.
63
63
64
64
This library also supports streaming encoding and decoding, returning web-standard `TransformStream` instances. This uses native `CompressionStream`/`DecompressionStream` where available (all modern browsers and Node 18+).
65
65
66
+
### `createDecodeStream(encoding)`
67
+
68
+
Takes an encoding (in the format of a standard HTTP [content-encoding header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding)) and returns a `TransformStream` that decodes data with the specified encoding(s), or `null` if no transformation is needed (identity encoding or undefined).
69
+
70
+
The encoding can be a string (e.g. `'gzip'` or `'gzip, base64'`), an array of strings, or undefined.
71
+
72
+
### `createEncodeStream(encoding)`
73
+
74
+
Takes an encoding (a valid HTTP [content-encoding](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding) name) and returns a `TransformStream` that encodes data with the specified encoding(s), or `null` if no transformation is needed (identity encoding or undefined).
75
+
76
+
The encoding can be a string (e.g. `'gzip'` or `'gzip, base64'`), an array of strings, or undefined.
77
+
78
+
### Per-codec streaming methods
79
+
66
80
*`createGzipStream`
67
81
*`createGunzipStream`
68
82
*`createDeflateStream`
@@ -73,6 +87,8 @@ This library also supports streaming encoding and decoding, returning web-standa
0 commit comments