1const readline = require("readline");
2
3const rl = readline.createInterface({
4 input: process.stdin,
5 output: process.stdout
6});
7
8rl.question("What is your name ? ", function saveInput(name) {
9 console.log(`His name is ${name}`);
10 rl.close();
11});
12
13rl.on("close", function saveInput() {
14 console.log("\nBYE BYE !!!");
15 process.exit(0);
16});
1const readline = require("readline");
2const rl = readline.createInterface({
3 input: process.stdin,
4 output: process.stdout
5});
6
7rl.question("What is your name ? ", function(name) {
8 rl.question("Where do you live ? ", function(country) {
9 console.log(`${name}, is a citizen of ${country}`);
10 rl.close();
11 });
12});
13
14rl.on("close", function() {
15 console.log("\nBYE BYE !!!");
16 process.exit(0);
17});