// Uncaught error timeout
setTimeout(() => { throw new Error(); }, 5000);
const input = Deno.stdin;
input.setRaw(true, Deno.build.os === "windows" ? undefined : { cbreak: true });
while (true) {
let bytes: Uint8Array = new Uint8Array(4096);
// If an uncaught error occurs somewhere else
// Deno waits for the read to complete before exiting.
await input.read(bytes);
console.log("read some bytes");
/* ... */
}
// Uncaught error timeout
setTimeout(() => { throw new Error(); }, 5000);
const input = Deno.stdin;
input.setRaw(true, Deno.build.os === "windows" ? undefined : { cbreak: true });
while (true) {
let bytes: Uint8Array = new Uint8Array(4096);
// If an uncaught error occurs somewhere else
// Deno waits for the read to complete before exiting.
await input.read(bytes);
console.log("read some bytes");
/* ... */
}