← Back to release summary

TextEncoderStream and TextDecoderStream APIs

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 71)
Intent stage
None

Summary

Text encoding and decoding will support streams to enable you to easily convert streams of binary data to text and vice-versa. An example of its usefulness is with readable streams. With a non-stream Response object, response.Body.text() returns text. There is no equivalent for the ReadableStream returned by Response.Body, which can only return bytes. With the new API a streaming response body may be converted to text as so: Response.Body.pipeThrough(new TextDecoderStream()).

Standards & signals

Docs: https://github.com/ricea/encoding-streams/blob/master/stream-explainer.md

View on chromestatus.com