Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Deno.writeAll

deprecated

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
@deprecated

Use writeAll from https://deno.land/std/streams/conversion.ts instead. Deno.writeAll will be removed in Deno 2.0.

function writeAll(w: Writer, arr: Uint8Array): Promise<void>;
§
writeAll(w: Writer, arr: Uint8Array): Promise<void>
[src]

§Parameters

§
arr: Uint8Array
[src]

§Return Type

§
Promise<void>
[src]