Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
function toReadableStream
import { toReadableStream } from "";

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).


Example 1

import { toReadableStream } from "";

const file = await"./file.txt", { read: true });
const fileStream = toReadableStream(file);


reader: Reader | (Reader & Closer)
unnamed 1: ToReadableStreamOptions = [UNSUPPORTED]