Function writeAll

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

    Parameters

    • writer: Writer

      The writer to write to

    • data: Uint8Array

      The data to write

    Returns Promise<void>

    import { writeAll } from "@std/io/write-all";

    const contentBytes = new TextEncoder().encode("Hello World");
    await writeAll(Deno.stdout, contentBytes);
    import { writeAll } from "@std/io/write-all";

    const contentBytes = new TextEncoder().encode("Hello World");
    using file = await Deno.open('test.file', { write: true });
    await writeAll(file, contentBytes);