I am trying to read the data entry from keyboard in NodeJS, I would like to know how to do this in the way that java has its scanner or c ++ has something similar, I hope to give you to understand.
I am trying to read the data entry from keyboard in NodeJS, I would like to know how to do this in the way that java has its scanner or c ++ has something similar, I hope to give you to understand.
Nodejs natively provides the openStdin()
function to accept keyboard entries, here's an example:
console.log("Escribe tu nombre");
var stdin = process.openStdin();
stdin.addListener("data", function(d) {
console.log("Tu nombre es: " +
d.toString().trim());
});