包详细信息

cursor-pos

ourarash2.2kMIT2.0.0

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

cursor, cursor, position, bash

自述文件

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.