MDN self-hosted library · e01.org

TextEncoderStream

Encoding API

no runnable cells web-api-interface upstream source

Encoding API

The TextEncoderStream interface of the 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.

Constructor

  • TextEncoderStream()
  • : Creates a new TextEncoderStream object.

Instance properties

  • TextEncoderStream.encoding
  • : Always returns "utf-8".
  • TextEncoderStream.readable
  • : Returns the ReadableStream instance controlled by this object.
  • TextEncoderStream.writable
  • : Returns the WritableStream instance controlled by this object.

Examples

Examples of streaming structured data and HTML

Specifications

Browser compatibility

See also