Creates a new DecompressionStream
object which decompresses a stream of
data.
Throws a TypeError
if the format passed to the constructor is not supported.
const gzip = new DecompressionStream("gzip");
The compression format to use.
Readonly
readablelet stream = new DecompressionStream("gzip");
console.log(stream.readable instanceof ReadableStream); // true
Readonly
writablelet stream = new DecompressionStream("gzip");
console.log(stream.writable instanceof WritableStream); // true
Generated using TypeDoc
An API for decompressing a stream of data.
See
DecompressionStream on MDN
Example
In this example a request is made to httpbin.org/gzip and the response body is decompressed using gzip decompression.
View this example on Fiddle.