2.0.0 • Published 2 years ago

cursor-pos v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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.