CompressionStream

The CompressionStream interface of the Compression Streams API is an API for compressing a stream of data.

Constructor

CompressionStream.CompressionStream()

Creates a new CompressionStream

Properties

CompressionStream.readable

Returns the ReadableStream instance controlled by this object.

CompressionStream.writable

Returns the WritableStream instance controlled by this object.

Examples

In this example a stream is compressed using gzip compression.

const compressedReadableStream = inputReadableStream.pipeThrough(new CompressionStream('gzip'));

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
CompressionStream
80
80
No
No
67
No
80
80
No
57
No
13.0
CompressionStream
80
80
No
No
67
No
80
80
No
57
No
13.0
readable
80
80
No
No
67
No
80
80
No
57
No
13.0
writable
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/CompressionStream