deno / 1.23.2 / ~ / deno.isatty.html /

Deno.isatty

Check if a given resource id (rid) is a TTY.

// This example is system and context specific
const nonTTYRid = Deno.openSync("my_file.txt").rid;
const ttyRid = Deno.openSync("/dev/tty6").rid;
console.log(Deno.isatty(nonTTYRid)); // false
console.log(Deno.isatty(ttyRid)); // true
Deno.close(nonTTYRid);
Deno.close(ttyRid);
function isatty( rid: number) : boolean;
isatty( rid: number) : boolean

Parameters

rid: number

Return Type

boolean

© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/Deno.isatty