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 inWeb Workers.
TheDecompressionStream interface of theCompression Streams API decompresses a stream of data. It implements the same shape as aTransformStream, allowing it to be used inReadableStream.pipeThrough() and similar methods.
In this article
Constructor
DecompressionStream()Creates a new
DecompressionStream
Instance properties
DecompressionStream.readableReturns the
ReadableStreaminstance controlled by this object.DecompressionStream.writableReturns the
WritableStreaminstance controlled by this object.
Examples
In this example a blob is decompressed using gzip compression.
js
const ds = new DecompressionStream("gzip");const decompressedStream = blob.stream().pipeThrough(ds);Specifications
| Specification |
|---|
| Compression> # decompression-stream> |