dom / latest / decompressionstream / decompressionstream.html /

DecompressionStream()

The DecompressionStream() constructor creates a new DecompressionStream object which decompresses a stream of data.

Syntax

new DecompressionStream(format);

Parameters

format

One of the following compression formats:

  • "gzip"
  • "deflate"

Exceptions

TypeError

Thrown if the format passed to the constructor is not supported.

Examples

In this example a blob is decompressed using gzip compression.

const ds = new DecompressionStream('gzip');
const decompressedStream = blob.stream().pipeThrough(ds);

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
DecompressionStream
80
80
No
No
67
No
80
80
No
57
No
13.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream/DecompressionStream