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

x/levo/templates/new-project/lib/lib.deno_runtime.d.ts>Deno.isatty

Server side rendering with The Elm Architecture in Deno
Latest
function Deno.isatty
import { Deno } from "https://deno.land/x/levo@v0.0.27/templates/new-project/lib/lib.deno_runtime.d.ts";
const { isatty } = Deno;

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);

Parameters

rid: number

Returns

boolean