Move a terminal cursor (right, left, up, down, etc).
$ npm install --save move-terminal-cursor
var move = require("move-terminal-cursor")
move("up", {count: 5})
move("down", {count: 5})
move("right", {count: 5})
move("left", {count: 5})
move("nextLine", {count: 5})
move("prevLine", {count: 5})
move("toCol", {col: 10})
move("toPos", {row: 10, col: 10})
console.log("Meow")
Moves the terminal cursor.
Name | Type | Description |
---|---|---|
type | String |
Where you want the cursor to move. |
opts | Object |
Options (see available options below) |
types |
---|
up |
down |
right |
left |
nextLine |
prevLine |
toCol |
toPos |
Name | Type | Description |
---|---|---|
x | Number |
The x cord. |
y | Number |
The y cord. |
count | Number |
The number of movements. |
Must provide 'count' key/value to options object.
move("up", {count: 5})
Must provide 'count' key/value to options object.
move("down", {count: 5})
Must provide 'count' key/value to options object.
move("right", {count: 5})
Must provide 'count' key/value to options object.
move("left", {count: 5})
Must provide 'count' key/value to options object.
move("nextLine", {count: 5})
Must provide 'count' key/value to options object.
move("prevLine", {count: 5})
Must provide 'col' key/value to options object.
move("toCol", {col: 5})
Must provide 'col' and 'row' key/values to options object.
move("toPos", {row: 5, col: 10})
- terminal-cursor - Manipulate and keep track of the terminal cursor (move, hide, show, etc)
MIT © Joe Gesualdo