1//Node.js readline
2const readline = require('readline');
3
4const rl = readline.createInterface({
5 input: process.stdin,
6 output: process.stdout
7});
8
9rl.question('What do you think of Node.js? ', (answer) => {
10 console.log(`Thank you for your valuable feedback: ${answer}`);
11 rl.close();
12});
1readline = require('readline').createInterface({
2 input: process.stdin,
3 output: process.stdout
4})
5
6readline.on("line", (line) => {
7 if (line === "") {
8 // Code
9 }
10 else if (line === "") {
11 // Code
12 }
13})