DenoDDeno
Powered by
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
Deno.stdin
?
Like i can just search in a map, what key
27
27
represents?
Also, i cant use
stdin.setRaw(false)
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();
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();
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

deno command stdin, stdout continous reading
TangJieHaoTTangJieHao / help
3y ago
Preventing `Deno.stdin` reads from blocking
vukmeanswolfVvukmeanswolf / help
3y ago
How to re-open Deno.stdin?
mattvrMmattvr / help
3y ago
Synchronous read single line from Deno.stdin
Octal!OOctal! / help
4y ago