TextEncoderStream

The TextEncoderStream interface of the Encoding API converts a stream of strings into bytes in the UTF-8 encoding. It is the streaming equivalent of TextEncoder. It implements the same shape as a TransformStream, allowing it to be used in ReadableStream.pipeThrough() and similar methods.

MDN Reference

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open val encoding: String

Returns "utf-8".

Link copied to clipboard

The readable read-only property of the TextEncoderStream interface returns a ReadableStream that emits encoded binary data as Uint8Array chunks.

Link copied to clipboard
open override val writable: WritableStream<JsString>

The writable read-only property of the TextEncoderStream interface returns a WritableStream that accepts strings to be encoded into binary data.