Answers for "node js get input from command line"

2

get input in terminal nodejs

const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

readline.question('Who are you?', name => {
  console.log(`Hey there ${name}!`);
  readline.close();
});
Posted by: Guest on May-27-2021
-2

how to get input from user in nodejs

const readline = require('readline').createInterface({  input: process.stdin,  output: process.stdout}); readline.question('Who are you?', name => {  console.log(`Hey there ${name}!`);  readline.close();});
Posted by: Guest on December-16-2020

Code answers related to "node js get input from command line"

Code answers related to "Javascript"

Browse Popular Code Answers by Language