Sha256: 6eb79e02a1b6ed22b6466ca5616f1d0d29ca624b2cc13ffe761f514ee706e33a

Contents?: true

Size: 1.15 KB

Versions: 47

Compression:

Stored size: 1.15 KB

Contents

'use strict';
var ansiEscapes = require('ansi-escapes');

/**
 * Move cursor left by `x`
 * @param  {Readline} rl - Readline instance
 * @param  {Number}   x  - How far to go left (default to 1)
 */

exports.left = function(rl, x) {
  rl.output.write(ansiEscapes.cursorBackward(x));
};

/**
 * Move cursor right by `x`
 * @param  {Readline} rl - Readline instance
 * @param  {Number}   x  - How far to go left (default to 1)
 */

exports.right = function(rl, x) {
  rl.output.write(ansiEscapes.cursorForward(x));
};

/**
 * Move cursor up by `x`
 * @param  {Readline} rl - Readline instance
 * @param  {Number}   x  - How far to go up (default to 1)
 */

exports.up = function(rl, x) {
  rl.output.write(ansiEscapes.cursorUp(x));
};

/**
 * Move cursor down by `x`
 * @param  {Readline} rl - Readline instance
 * @param  {Number}   x  - How far to go down (default to 1)
 */

exports.down = function(rl, x) {
  rl.output.write(ansiEscapes.cursorDown(x));
};

/**
 * Clear current line
 * @param  {Readline} rl  - Readline instance
 * @param  {Number}   len - number of line to delete
 */
exports.clearLine = function(rl, len) {
  rl.output.write(ansiEscapes.eraseLines(len));
};

Version data entries

47 entries across 46 versions & 3 rubygems

Version Path
govuk_publishing_components-18.0.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.21.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.20.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.19.1 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.19.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.18.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.17.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.16.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.15.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.14.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.13.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.12.2 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.12.1 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.12.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.11.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.10.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.9.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.8.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.7.0 node_modules/standard/node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.6.1 node_modules/standard/node_modules/inquirer/lib/utils/readline.js