Skip to main content
Module

x/oak/utils/streams.ts>readableStreamFromReader

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Extremely Popular
Go to Latest
function readableStreamFromReader
import { readableStreamFromReader } from "https://deno.land/x/oak@v16.0.0/utils/streams.ts";

Create a ReadableStream<Uint8Array> 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).

Parameters

reader: Reader | (Reader & Closer)
optional
options: ReadableStreamFromReaderOptions = [UNSUPPORTED]