Cliffy

Tty

The tty module exports a tty object which works almost the same way as the ansi module. The only difference is, the tty module writes the ansi escape sequences directly to stdout.

import { tty } from "https://deno.land/x/cliffy@v0.25.0/ansi/tty.ts";

tty.cursorSave
  .cursorHide
  .cursorTo(0, 0)
  .eraseScreen();Copy

Create a new instance.

import { tty } from "https://deno.land/x/cliffy@v0.25.0/ansi/tty.ts";

const myTty = tty({
  stdout: Deno.stdout,
  stdin: Deno.stdin,
});

myTty.cursorSave
  .cursorHide
  .cursorTo(0, 0)
  .eraseScreen();Copy