scroll/src/bun/index.ts

15 lines
305 B
JavaScript
Raw Normal View History

2023-10-31 14:47:59 -04:00
/**
* The main entrypoint when using Deno as the runtime
*/
export async function main(): Promise<number> {
const decoder = new TextDecoder();
for await (const chunk of Bun.stdin.stream()) {
const char = String(decoder.decode(chunk)).trim();
if (char === 'q') {
return 0;
}
}
return -1;
}