Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cursor-pos

ourarash2.5kMIT2.0.0

A bash-based package to get the current position in the terminal.

cursor, cursor, position, bash, terminal

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.