Skip to main content
Deno 2 is finally here 🎉️
Learn more

termbox

Termbox is a deno package that provides a cell based view for text terminals.

Usage

import TermBox from "https://deno.land/x/termbox@v0.1.3/mod.ts";

const termbox = new TermBox();

termbox.setCell(x, y, "a");

Interface

class TermBox {
  constructor(size?: Size);
  flush(): Promise<void>;
  size(): Size;
  end(): void;

  setCell(x: number, y: number, char: string): void;

  cursorHide(): Promise<void>;
  cursorShow(): Promise<void>;
  cursorSave(): Promise<void>;
  cursorRestore(): Promise<void>;
  cursorTo(x: number, y: number): Promise<void>;
  cursorPosition(): Promise<Size>;

  screenClear(): Promise<void>;
  screenReset(): Promise<void>;
}

interface Size {
  columns: number;
  rows: number;
}

example

https://github.com/deno-library/sl