From 8155f4dc739067e72e6bdd6fbc8e993fd1b935f0 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Wed, 8 Nov 2023 12:45:04 -0500 Subject: [PATCH] Setup basic terminal output for Bun runtime --- src/bun/terminal_io.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bun/terminal_io.ts b/src/bun/terminal_io.ts index 6491efd..0613273 100644 --- a/src/bun/terminal_io.ts +++ b/src/bun/terminal_io.ts @@ -5,4 +5,10 @@ export async function* inputLoop() { for await (const chunk of Bun.stdin.stream()) { yield chunk; } -} \ No newline at end of file +} + +export async function write(s: string): Promise { + const buffer = new TextEncoder().encode(s); + + await Bun.write(Bun.stdout, buffer); +}