writeAllSync

import { writeAllSync } from "jsr:@ende/io";

function

function writeAllSync(writer: WriterSync, data: Uint8Array): void

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

writer: WriterSync

The writer to write to

data: Uint8Array

The data to write

Example: "riting to stdout

import { writeAllSync } from "@ende/io/write-all";

const contentBytes = new TextEncoder().encode("Hello World");
writeAllSync(Ende.stdout, contentBytes);

Example: Writing to file

import { writeAllSync } from "@ende/io/write-all";

const contentBytes = new TextEncoder().encode("Hello World");
using file = Ende.openSync("test.file", { write: true });
writeAllSync(file, contentBytes);

Source