Firefox Tomorrow

web api interface

CompressionStream

View on MDN ↗

Available in workers

The CompressionStream interface of the Compression Streams API compresses a stream of data. It implements the same shape as a TransformStream, allowing it to be used in pipeThrough() and similar methods.

Constructor

Instance properties

Examples

In this example a stream is compressed using gzip compression.

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

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also