Created
June 1, 2020 12:59
-
-
Save zored/708713156b4bcfebad4011c16bfe893c to your computer and use it in GitHub Desktop.
Deno read one symbol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S deno run --unstable | |
while (true) { | |
const buffer = new Uint8Array(1); | |
Deno.setRaw(0, true); | |
await Deno.stdin.read(buffer); | |
Deno.setRaw(0, false); | |
console.log(buffer); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment