Deprecated
(will be removed after 1.0.0) Use {@link ReadableStreamDefaultReader
} directly.
Create a Reader
from a ReadableStreamDefaultReader
.
import { readerFromStreamReader } from "https://dotland.deno.dev/x/wmill@v1.364.1/deps.ts";
Examples
Example 1
Example 1
import { copy } from "https://deno.land/std@$STD_VERSION/streams/copy.ts";
import { readerFromStreamReader } from "https://deno.land/std@$STD_VERSION/streams/reader_from_stream_reader.ts";
const res = await fetch("https://deno.land");
const file = await Deno.open("./deno.land.html", { create: true, write: true });
const reader = readerFromStreamReader(res.body!.getReader());
await copy(reader, file);
file.close();