How to use the npm-user-validate.pw function in npm-user-validate

To help you get started, we’ve selected a few npm-user-validate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github davidhealey / waistline / node_modules / npm / lib / adduser.js View on Github external
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"

npm-user-validate

User validations for npm

BSD-2-Clause
Latest version published 2 months ago

Package Health Score

86 / 100
Full package analysis