function toReadableStream
toReadableStream(unnamed 1?: ToReadableStreamOptions): ReadableStream<Uint8Array>Create a ReadableStream of Uint8Arrays from a
Reader.
When the pull algorithm is called on the stream, a chunk from the reader
will be read. When null is returned from the reader, the stream will be
closed along with the reader (if it is also a Closer).
Examples
Example 1
Example 1
import { toReadableStream } from "@std/io/to_readable_stream"; const file = await Deno.open("./file.txt", { read: true }); const fileStream = toReadableStream(file);
Parameters
optional
unnamed 1: ToReadableStreamOptions