Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback


Command line framework for deno πŸ¦• Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
#!/usr/bin/env -S deno run --unstable
import { KeyCode } from "../../keycode/key_code.ts";
async function read(): Promise<void> { const buffer = new Uint8Array(8);
Deno.setRaw(Deno.stdin.rid, true); const nread = await; Deno.setRaw(Deno.stdin.rid, false);
if (nread === null) { return; }
const data = buffer.subarray(0, nread);
const [event] = KeyCode.parse(data);
if (event?.name === "c" && event.ctrl) { console.log("exit"); return; }
await read();}
console.log("Hit ctrl + c to exit.");
await read();