????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.3 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/nodejs/ |
Upload File : |
module.exports = read
var readline = require('readline')
var Mute = require('mute-stream')
function read (opts, cb) {
if (opts.num) {
throw new Error('read() no longer accepts a char number limit')
}
if (typeof opts.default !== 'undefined' &&
typeof opts.default !== 'string' &&
typeof opts.default !== 'number') {
throw new Error('default value must be string or number')
}
var input = opts.input || process.stdin
var output = opts.output || process.stdout
var m = new Mute({ replace: opts.replace })
m.pipe(output, {end: false})
output = m
var def = opts.default || ''
var terminal = !!(opts.terminal || output.isTTY)
var rlOpts = { input: input, output: output, terminal: terminal }
if (process.version.match(/^v0\.6/)) {
var rl = readline.createInterface(rlOpts.input, rlOpts.output)
} else {
var rl = readline.createInterface(rlOpts)
}
var prompt = (opts.prompt || '').trim() + ' '
var silent = opts.silent
var editDef = false
var timeout = opts.timeout
if (def) {
if (silent) {
prompt += '(<default hidden>) '
} else if (opts.edit) {
editDef = true
} else {
prompt += '(' + def + ') '
}
}
output.unmute()
rl.setPrompt(prompt)
rl.prompt()
if (silent) {
output.mute()
} else if (editDef) {
rl.line = def
rl.cursor = def.length
rl._refreshLine()
}
var called = false
rl.on('line', onLine)
rl.on('error', onError)
rl.on('SIGINT', function () {
rl.close()
onError(new Error('canceled'))
})
var timer
if (timeout) {
timer = setTimeout(function () {
onError(new Error('timed out'))
}, timeout)
}
function done () {
called = true
rl.close()
if (process.version.match(/^v0\.6/)) {
rl.input.removeAllListeners('data')
rl.input.removeAllListeners('keypress')
rl.input.pause()
}
clearTimeout(timer)
output.mute()
output.end()
}
function onError (er) {
if (called) return
done()
return cb(er)
}
function onLine (line) {
if (called) return
if (silent && terminal) {
output.unmute()
output.write('\r\n')
}
done()
// truncate the \n at the end.
line = line.replace(/\r?\n$/, '')
var isDefault = !!(editDef && line === def)
if (def && !line) {
isDefault = true
line = def
}
cb(null, line, isDefault)
}
}