Setup basic terminal output for Bun runtime

This commit is contained in:
Timothy Warren 2023-11-08 12:45:04 -05:00
parent f238b162f6
commit 8155f4dc73
1 changed files with 7 additions and 1 deletions

View File

@ -5,4 +5,10 @@ export async function* inputLoop() {
for await (const chunk of Bun.stdin.stream()) {
yield chunk;
}
}
}
export async function write(s: string): Promise<void> {
const buffer = new TextEncoder().encode(s);
await Bun.write(Bun.stdout, buffer);
}