Skip to content

Instantly share code, notes, and snippets.

@zored
Created June 1, 2020 12:59
Show Gist options
  • Save zored/708713156b4bcfebad4011c16bfe893c to your computer and use it in GitHub Desktop.
Save zored/708713156b4bcfebad4011c16bfe893c to your computer and use it in GitHub Desktop.
Deno read one symbol
#!/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