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

Specification Status Comment
Compression Streams
The definition of 'CompressionStream' in that specification.
Draft Initial definition.

Browser compatibility

BCD tables only load in the browser