09. Inquirer Demo π©βπ«π§βπ«
index.js
const inquirer = require('inquirer');
inquirer
.prompt([
{
type: 'input',
message: 'What is your user name?',
name: 'username',
},
{
type: 'password',
message: 'What is your password?',
name: 'password',
},
{
type: 'password',
message: 'Re-enter password to confirm:',
name: 'confirm',
},
])
.then((response) =>
response.confirm === response.password
? console.log('Success!')
: console.log('You forgot your password already?!')
);
package.json
{
"name": "14-Ins-Inquirer-Demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"inquirer": "^6.5.0"
}
}