web api interface
TextEncoderStream
Available in workers
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 pipeThrough() and similar methods.
Constructor
TextEncoderStream()- : Creates a new
TextEncoderStreamobject.
- : Creates a new
Instance properties
encodingRead only- : Always returns
"utf-8".
- : Always returns
readableRead only- : Returns the
ReadableStreaminstance controlled by this object.
- : Returns the
writableRead only- : Returns the
WritableStreaminstance controlled by this object.
- : Returns the
Examples
Examples of streaming structured data and HTML
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
TextDecoderStreamTextEncoderTransformStream- Streams API Concepts
- Experimenting with the Streams API
- Streaming requests with the fetch API, developer.chrome.com (2020)