diff --git a/bril-ts/util.ts b/bril-ts/util.ts index 40b0dfbb9..5e5a74932 100644 --- a/bril-ts/util.ts +++ b/bril-ts/util.ts @@ -2,8 +2,12 @@ * Read all the data from stdin as a string. */ export async function readStdin(): Promise { - const buf = await Deno.readAll(Deno.stdin); - return (new TextDecoder()).decode(buf); + let buf = ""; + const dec = new TextDecoder(); + for await (const chunk of Deno.stdin.readable) { + buf += dec.decode(chunk); + } + return buf; } export function unreachable(x: never): never {