UNPKG

deep-package-manager

Version:
66 lines (55 loc) 1.19 kB
/** * Created by AlexanderC on 11/18/15. */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReadlineSync = undefined; var _readlineSync = require('readline-sync'); var _readlineSync2 = _interopRequireDefault(_readlineSync); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class ReadlineSync { /** * @param {Object} options */ constructor(options = {}) { this._options = options; } /** * @todo: remove this? * * @returns {Object} */ get options() { return this._options; } /** * @param {Object} options * @returns {ReadlineSync|*} */ static createInterface(options = {}) { return new this(options); } /** * @param {String} text * @param {Function} cb */ questionHidden(text, cb = () => {}) { cb(_readlineSync2.default.question(text, { hideEchoBack: true })); } /** * @param {String} text * @param {Function} cb */ question(text, cb = () => {}) { cb(_readlineSync2.default.question(text)); } /** * rlInterface compatibility */ close() {} } exports.ReadlineSync = ReadlineSync;