cursor-pos
v2.0.0
Published
A bash-based package to get the current position in the terminal.
Downloads
2,804
Maintainers
Readme
cursor-pos
A bash-based package to get the current position in the terminal.
Will only work on systems that have bash.
Installation
Install with npm:
npm install cursor-pos
Usage
const getCursorPosition = require('./cursor-pos');
async function main() {
let pos = await getCursorPosition();
console.log('pos: ', pos);
}
main();
Output:
pos: { row: 13, column: 0 }
Credit
Inspired by cursor.js from here.