Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function readPassword (c, u, cb) {
var v = userValidate.pw
var prompt
if (c.p && !c.changed) {
prompt = "Password: (or leave unchanged) "
} else {
prompt = "Password: "
}
read({prompt: prompt, silent: true}, function (er, pw) {
if (er) {
return cb(er.message === "cancelled" ? er.message : er)
}
if (!c.changed && pw === "") {
// when the username was not changed,
// empty response means "use the old value"