更新时间:2023-01-30 20:40:14
如果您不需要异步的东西,我也建议您使用readline-sync模块.
I would suggest the readline-sync module as well if you don't require something asynchronous.
# npm install readline-sync
const readline = require('readline-sync');
let name = readline.question("What is your name?");
console.log("Hi " + name + ", nice to meet you.");