DNAD
Denoβ€’2y agoβ€’
2 replies
DNA

Deno.stdin raw map?

Does anyone have a map to which key is what raw buffer gotten from Deno.stdin?
Like i can just search in a map, what key 27 represents?
Also, i cant use stdin.setRaw(false)

Code:
const stdin = Deno.stdin;
stdin.setRaw(true, {cbreak: Deno.build.os !== "windows"});

const maxBuffer = new Uint8Array(1024);
const read = async () => {
    const size = await stdin.read(maxBuffer);
    const buffer = maxBuffer.subarray(0, size || 0).toString();

    Deno.writeTextFileSync("buffer.txt", buffer + "\n", {append: true});

    setTimeout(read, 1000 / 60);
};

read();
Was this page helpful?