DecompressionStream
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since May 2023.
* Some parts of this feature may have varying levels of support.
Note: This feature is available in Web Workers.
The DecompressionStream interface of the Compression Streams API decompresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.
Constructor
DecompressionStream()-
Creates a new
DecompressionStream
Instance properties
DecompressionStream.readable-
Returns the
ReadableStreaminstance controlled by this object. DecompressionStream.writable-
Returns the
WritableStreaminstance controlled by this object.
Examples
In this example a blob is decompressed using gzip compression.
const ds = new DecompressionStream("gzip");
const decompressedStream = blob.stream().pipeThrough(ds);
Specifications
| Specification |
|---|
| Compression # decompression-stream |
Browser compatibility
| desktop | mobile | server | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DecompressionStream
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DecompressionStream() constructor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"brotli" compression
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"deflate" compression
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"deflate-raw" compression
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"gzip" compression
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"zstd" compression
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- Non-standard. Check cross-browser support before using.
- See implementation notes.
- User must explicitly enable this feature.
- Has more compatibility info.