Console prompt
Prompts the user for information at the console in a nodejs programme.
Returns a Promise.
var prompt = ; ;
prompt
takes two parameters:
message
- String - text to display on the screenhidden
- Truthy - if truthy the user's input is replaced with stars.
Installation
$ npm install console-prompt
Issues
Pasting
The code reacts badly to \n
, and possibly many other characters, being pasted in.
Avoid.
Windows
In Windows, backspacing in a hidden field won't update on screen correctly unless you are using a terminal supporting ANSI escape sequences.
It should still collect the correct information, though.