of-course
v0.0.2
Published
Promise-based input prompting in the terminal.
Downloads
3
Readme
of-course
Promise-based input prompting in the terminal.
Installation
npm install --save of-course
Usage
const prompt = require('of-course');
(async () => {
let username = await prompt.string('Username: ');
let password = await prompt.password('Password: ');
let verify = await prompt.password('Password (check): ');
console.log({ username, password, verify });
})();
API
#string
Prompts for a string.
prompt.string('Username: ').then((username) => {
console.log(username);
});
#password
Prompts for a string, obscuring input.
prompt.password('Password: ').then((password) => {
console.log(password);
});