node package manager

js-csi

CSI ANSI escape codes

CSI

A little boilerplate is helpful to really get going with a UI in the terminal. These are the most basic functions you may want:

npm install js-csi
var CSI = require('js-csi');

Writes to process.stdout

Performs the command, e.g.

CSI.apply('10A'); //Moves cursor up ten lines 

Moves cursor to line, col[umn]. Column is optional (default: 1)

CSI.move(7,11); //Moves cursor to line 7, column 11 

Hides the cursor

Shows the cursor

Clears the given line. If no line is supplied, clears the entire screen

CSI.clear(4); //Clears line 4 
CSI.clear(); //Clears terminal screen