Preventing `Deno.stdin` reads from blocking
In a module for reading
My issue is that, in case of an uncaught error/rejection, the process hangs until
Is there a way to make this
If the user does not input anything, but an error occurs, the process should exit immediately and not have to wait for a keypress.
The code below can be run from a file for demonstration.
Deno.stdin input, there is a loop that reads and parses the returned bytes.My issue is that, in case of an uncaught error/rejection, the process hangs until
stdin has something to return, and once it does, only then does it exit the process and log the error information.Is there a way to make this
read() non-blocking in that sense?If the user does not input anything, but an error occurs, the process should exit immediately and not have to wait for a keypress.
The code below can be run from a file for demonstration.
