v151 · javascript · streams

textStream() for Response / Request / Blob

A convenience method equivalent to .body.pipeThrough(new TextDecoderStream()). Returns a ReadableStream<string> so you can consume text incrementally without manually wiring a TextDecoderStream.

concepts

  1. Streaming Text Reader

    Create a Blob, call textStream(), and watch text chunks arrive incrementally in real time. Compare with .text() (all-at-once) side by side.

  2. Response Pipeline

    Build a Response from a string, pipe its textStream() through a transform that uppercases each chunk, and read the result — demonstrating textStream() composes with standard stream APIs.

  3. Feature Detection

    Probe whether textStream() exists on Blob, Response, and Request, with a fallback to manual TextDecoderStream piping.

references

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗