如何在node.js中询问用户问题?例如
var getInformation = function(user, password) {
if (user == null) {
user = someMethod("User name: ")
}
if (password == null) {
password = someMethod("Password: ")
}
console.log("Your password is " + password + ".")
}
getInformation()
我不知道该为someMethod()
做什么,所以节点停止并等待提交然后继续并对密码执行相同的操作然后将密码记录给用户,那么这怎么可能呢?完成?