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.writeAll

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

Write all the content of the array buffer (arr) to the writer (w).

// Example writing to stdout
const contentBytes = new TextEncoder().encode("Hello World");
await Deno.writeAll(Deno.stdout, contentBytes);

// Example writing to file
const contentBytes = new TextEncoder().encode("Hello World");
const file = await Deno.open('test.file', {write: true});
await Deno.writeAll(file, contentBytes);
Deno.close(file.rid);

// Example writing to buffer
const contentBytes = new TextEncoder().encode("Hello World");
const writer = new Deno.Buffer();
await Deno.writeAll(writer, contentBytes);
console.log(writer.bytes().length);  // 11

Parameters

arr: Uint8Array

Returns

Promise<void>