this.in.removeListener('keypress', keypress); if (this.in.isTTY) this.in.setRawMode(false); rl.close(); this.emit(this.aborted ? 'abort' : 'submit', this.value); this.closed = true;
let question=function (title) { return new Promise(function (resolve,reject) { read.question(title,function (answer) { resolve(answer); })
rl.on('close', function() { // Print the welcome screen. util.log(''); util.log(fs.readFileSync('welcome.txt').toString().green); });
rl.on('line', function(line) { util.log( line.substring(0,4) + line.substring(4, 30).cyan.bold + line.substring(30, 33) + line.substring(33, 42).green.bold + line.substring(42) ); });
const Pregunta2 = () => { return new Promise((resolve, reject) => { rl.question('Ingrese su edad: ', (answer) => { return resolve(answer) }) }) }
// From here: http://stackoverflow.com/a/24519813/3296811 const fixedPrint = function (type, args) { const indent = Math.ceil((REPL.line.length + 3) / process.stdout.columns); const text = util.format.apply(console, args); REPL.output.write('\n\x1B[' + indent + 'A\x1B[0J'); // No idea at all.... REPL.output.write(text + '\n'); REPL.output.write(Array(indent).join('\n\x1B[E')); REPL._refreshLine(); }
rl.on('line', function (line) { lineno++; if (line === div) { record.push(lineno, bucket.join('\n')); records.push(record); record = [lineno + 1]; bucket = []; } else { bucket.push(line); } });
const readFileByLine = (name, callback) => { const lineReader = readline.createInterface({ input: fs.createReadStream(path.resolve(__dirname, name)) }); lineReader.on('line', line => { callback && callback(line); }); }
// If the cec-client pipe is closed monitor.on(CECMonitor.EVENTS._STOP, function () { console.log('cec-client exit') rl.prompt() })
cliinput.question("Please paste the code into this prompt and press enter to continue", function(code) { console.log("Token Accepted"); exports.config.code = code; exports.auth.getAccessToken(code,callback); })