Module

x/dax/src/deps.ts>readerFromStreamReader

Cross-platform shell tools for Deno and Node.js inspired by zx.
Extremely Popular
Latest
function readerFromStreamReader
Deprecated
Deprecated

(will be removed after 1.0.0) Use {@link ReadableStreamDefaultReader} directly.

import { readerFromStreamReader } from "https://dotland.deno.dev/x/dax@0.39.2/src/deps.ts";

Create a {@link Reader} from a {@link ReadableStreamDefaultReader}.

Examples

Example 1

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

Returns

Reader