Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function readerFromStreamReader
Deprecated
Deprecated

(will be removed in 1.0.0) Import from https://deno.land/std/io/reader_from_stream_reader.ts instead.

import { readerFromStreamReader } from "https://deno.land/std@0.218.2/streams/reader_from_stream_reader.ts";

Examples

Example 1

import { copy } from "https://deno.land/std@0.218.2/io/copy.ts";
import { readerFromStreamReader } from "https://deno.land/std@0.218.2/streams/reader_from_stream_reader.ts";

const res = await fetch("https://deno.land");
using file = await Deno.open("./deno.land.html", { create: true, write: true });

const reader = readerFromStreamReader(res.body!.getReader());
await copy(reader, file);

Parameters

streamReader: ReadableStreamDefaultReader<Uint8Array>