syncoprompt
v1.0.1
Published
minimalist zero-dependency cross-platform synchronous prompting module
Downloads
61
Maintainers
Readme
Syncoprompt
minimalist zero-dependency cross-platform synchronous prompting module
API
require('syncoprompt') => (question = '', opts = {hidden: false, echo: '*'}) => String => answer
Usage
var prompt = require('syncoprompt')
var name = prompt('Tell us yer name then: ')
var pwd = prompt('Password: ', {hidden: true, echo: '#'})
console.log('How do ya do', name, 'your password is', pwd)
Options
hidden
: Default is false
. This prevents echo-back during text entry
echo
: Default is '*'
. Echo character to be used when hidden. For no echo set this to ''
Credits
- prompt-sync for code and inspiration
- Sponsored by nearForm