web api interface
TextDecoderStream
Available in workers
The TextDecoderStream interface of the Encoding API converts a stream of text in a binary encoding, such as UTF-8 etc., to a stream of strings.
It is the streaming equivalent of TextDecoder.
It implements the same shape as a TransformStream, allowing it to be used in pipeThrough() and similar methods.
Constructor
TextDecoderStream()- : Creates a new
TextDecoderStreamobject.
- : Creates a new
Instance properties
encodingRead only- : An encoding.
fatalRead only- : A
Booleanindicating if the error mode is fatal.
- : A
ignoreBOMRead only- : A
Booleanindicating whether the byte order mark is ignored.
- : A
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
TextEncoderStreamTextDecoderTransformStream- Streams API Concepts
- Experimenting with the Streams API
- Streaming requests with the fetch API, developer.chrome.com (2020)