Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function readerFromStreamReader
Deprecated
Deprecated

(will be removed after 1.0.0) Use ReadableStreamDefaultReader directly.

import { readerFromStreamReader } from "https://deno.land/x/fathym_eac_runtime@v0.0.140/src/src.deps.ts";

Examples

Example 1

import { copy } from "https://deno.land/std@0.224.0/io/copy.ts";
import { readerFromStreamReader } from "https://deno.land/std@0.224.0/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>