Answers for "nodejs write and read console input"

0

node js get input from console

--------------- easiest method I found---------------------------
  
Run npm install prompt-sync in the terminal
const prompt = require('prompt-sync')();

var name = prompt('what is your name?');

console.log(name);

--------------------------------------------------------------
Posted by: Guest on March-25-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language