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