Skip to main content
Module

x/oak/deps.ts>readAll

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Extremely Popular
Go to Latest
function readAll
import { readAll } from "https://deno.land/x/oak@v14.1.1/deps.ts";

Read Reader r until EOF (null) and resolve to the content as Uint8Array.

Examples

Example 1

import { readAll } from "https://deno.land/std@0.224.0/io/read_all.ts";

// Example from stdin
const stdinContent = await readAll(Deno.stdin);

// Example from file
using file = await Deno.open("my_file.txt", {read: true});
const myFileContent = await readAll(file);

Parameters

reader: Reader

Returns

Promise<Uint8Array>