Compression

Compression Streams Standard Compresses data in a streaming fashion using a specified algorithm.

Data written to the writable side is compressed and made available on the readable side. Supports "gzip", "deflate", "deflate-raw", and "br" (Brotli) formats.

Module: whatwg.compression Support: Experimental Since: 1.1.0 Docs: WHATWG Docs

Interface CompressionStream

Compresses data in a streaming fashion using a specified algorithm.

Data written to the writable side is compressed and made available on the readable side. Supports "gzip", "deflate", "deflate-raw", and "br" (Brotli) formats.

Since: 1.1.0 Docs: WHATWG Docs

3 members: 3 undocumented

Constructors

⚪ constructor(format)
string

Properties

⚪ readable
→ ReadableStream
⚪ writable
The readable side of the compression transform, producing compressed chunks.

---

Details

constructor(format)

new constructor(format: string) new constructor(format: string)
ParameterTypeDescription
formatstringThe compression format: "gzip", "deflate", "deflate-raw", or "br".
Throws:
  • TypeError --- If the format is not a supported compression algorithm.

readable

readable: ReadableStream

readable: ReadableStream

Throws:
  • TypeError --- If the format is not a supported compression algorithm.

---

Interface DecompressionStream

Decompresses data in a streaming fashion using a specified algorithm.

Data written to the writable side is decompressed and made available on the readable side. Supports "gzip", "deflate", "deflate-raw", and "br" (Brotli) formats.

Since: 1.1.0 Docs: WHATWG Docs

3 members: 3 undocumented

Constructors

⚪ constructor(format)
string

Properties

⚪ readable
→ ReadableStream
⚪ writable
The readable side of the compression transform, producing compressed chunks.

---

Details

constructor(format)

new constructor(format: string) new constructor(format: string)
ParameterTypeDescription
formatstringThe compression format: "gzip", "deflate", "deflate-raw", or "br".
Throws:
  • TypeError --- If the format is not a supported compression algorithm.

readable

readable: ReadableStream

readable: ReadableStream

Throws:
  • TypeError --- If the format is not a supported compression algorithm.

---