Skip to main content

@std/streams@0.215.0

latest
Works with
It is unknown whether this package works with Node.js, Deno, Browsers, Cloudflare Workers, Bun
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score70%
Published2 years ago (0.215.0)
function readableStreamFromReader
readableStreamFromReader(): ReadableStream<Uint8Array>
Deprecated

(will be removed after 1.0.0) Use toReadableStream instead.

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

An example converting a Deno.FsFile into a readable stream:

import { readableStreamFromReader } from "@std/streams/readable_stream_from_reader";

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

Parameters

Return Type

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/streams

Import symbol

import { readableStreamFromReader } from "@std/streams/readable_stream_from_reader";
or

Import directly with a jsr specifier

import { readableStreamFromReader } from "jsr:@std/streams/readable_stream_from_reader";