Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. CompressionStream

CompressionStream

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨May 2023⁩.

* Some parts of this feature may have varying levels of support.

Note: This feature is available inWeb Workers.

TheCompressionStream interface of theCompression Streams API compresses a stream of data. It implements the same shape as aTransformStream, allowing it to be used inReadableStream.pipeThrough() and similar methods.

Constructor

CompressionStream()

Creates a newCompressionStream.

Instance properties

CompressionStream.readable

Returns theReadableStream instance controlled by this object.

CompressionStream.writable

Returns theWritableStream instance controlled by this object.

Examples

In this example a stream is compressed using gzip compression.

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

Specifications

Specification
Compression
# compression-stream

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp