scroll/src/deno/index.ts

15 lines
306 B
JavaScript

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