Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/levo/templates/new-project/lib/lib.deno_runtime.d.ts>Deno.readAll

Server side rendering with The Elm Architecture in Deno
Latest
function Deno.readAll
import { Deno } from "https://deno.land/x/levo@v0.0.27/templates/new-project/lib/lib.deno_runtime.d.ts";
const { readAll } = Deno;

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

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

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

// Example from buffer
const myData = new Uint8Array(100);
// ... fill myData array with data
const reader = new Deno.Buffer(myData.buffer as ArrayBuffer);
const bufferContent = await Deno.readAll(reader);

Returns

Promise<Uint8Array>