Manipulate the terminal cursor (move, hide, show, etc)
$ npm install --save terminal-cursor
var Cursor = require("terminal-cursor")
var cursor = new Cursor(0, 0)
cursor.move("down", 2)
console.log("Hello")
cursor.move("down", 4)
console.log("World")
$ npm test
Creates an instance of Cursor at a given position
Name | Type | Description |
---|---|---|
xPos | Number |
x coordinate of the cursor you are creating |
yPos | Number |
y coordinate of the cursor you are creating |
Returns a Cursor
instance
var Cursor = require("terminal-cursor")
var cursor = new Cursor(0, 0)
cursor.move("down", 2)
console.log("Hello")
cursor.move("down", 4)
console.log("World")
Moves the cursor in a given position
Name | Type | Description |
---|---|---|
type | String |
Type of movement: "up", "down", "right", "left" |
count | Number |
How many times should the cursor move. |
var Cursor = require("terminal-cursor")
var cursor = new Cursor(0, 0)
cursor.move("down", 2)
console.log("Hello")
cursor.move("down", 4)
console.log("World")
Moves the cursor to a given coordinate
Name | Type | Description |
---|---|---|
xPos | Number |
The x coordinate where you want to move the cursor. |
yPos | Number |
The y coordinate where you want to move the cursor. |
var Cursor = require("terminal-cursor")
var cursor = new Cursor(0, 0)
cursor.movePos(5, 10)
console.log("Hello")
Displays the cursor
Hides the cursor
MIT © Joe Gesualdo