0.0.2 • Published 6 years ago
of-course v0.0.2
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);
});