cursor-pos

2.0.0 • Public • Published

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.

Package Sidebar

Install

npm i cursor-pos

Weekly Downloads

804

Version

2.0.0

License

MIT

Unpacked Size

2.43 kB

Total Files

5

Last publish

Collaborators

  • ourarash