8
In Java:
System.out.println("Diga algo: ");
Scanner leitor = new Scanner(System.in);
String resp = leitor.nextLine(); //ou nextInt, nextDouble, etc
In C++
cout << "Diga algo: ";
string name;
cin >> name;
How to read input from the console on Node.js?
For the example you have that just need to know the module to read data would probably be better to get this information through the program input arguments.
– Isac