reloquent

reloquent
allows to ask user a question.
reloquent(question:string, timeout?:number) => Interface
The function returns a readline instance, with .promise
property, which will resolve
when the user answers the question. You can also optionally supply a timeout argument after
which you want the promise to be rejected.
const reloquent = require('reloquent')
const rl = reloquent('How are you today? ')
rl.promise.then((answer) => {
console.log(`You've answered: %s`, answer)
})
const reloquent = require('reloquent')
const rl = reloquent('How are you today? ', 5000)
rl.promise.catch((err) => {
console.log(err)
console.log('Nevermind...')
})
todo
- show timer on the right
- accept other ios
- reject when closed without answer
(c) Sobesednik-Media 2017