DecompressionStream
Baseline 2023
Newly available
Since May 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Note: This feature is available in Web Workers.
The DecompressionStream
interface of the Compression Streams API is an API for decompressing a stream of data.
Constructor
DecompressionStream()
-
Creates a new
DecompressionStream
Instance properties
DecompressionStream.readable
-
Returns the
ReadableStream
instance controlled by this object. DecompressionStream.writable
-
Returns the
WritableStream
instance 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 Standard # decompression-stream |
Browser compatibility
BCD tables only load in the browser