Sha256: f79fe768e2a962250eacf59ff2c7565ce534b01ae62ca1226929537c2194172b

Contents?: true

Size: 1.15 KB

Versions: 108

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

108 entries across 108 versions & 4 rubygems

Version Path
govuk_publishing_components-17.6.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.5.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.4.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.3.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.2.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.1.1 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.1.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-17.0.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.29.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.28.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.27.1 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.27.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.26.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.25.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.24.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.23.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.22.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.21.0 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.20.1 node_modules/inquirer/lib/utils/readline.js
govuk_publishing_components-16.20.0 node_modules/inquirer/lib/utils/readline.js