ReadableStream Playground

Mrs. Sari’s kitchen is a ReadableStream’s source and her counter its queue: when does pull() cook, and does the counter ever pass the highWaterMark? Mr. Tono…

Why it matters

Large downloads, streaming API responses, reading from a socket: all can be larger than memory. A stream lets you process piece by piece, and backpressure holds a fast producer back so a slow consumer is not swamped. It is the foundation of fetch().body, file uploads and modern data pipelines.

The key idea

A stream asks for the next chunk only while there is room

Common mistakes

Try it in this playground