MCPcopy Index your code
hub / github.com/nodejs/node / readPasswords

Method readPasswords

deps/npm/lib/commands/profile.js:167–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165 let value = args.length > 1 ? args.slice(1).join(' ') : null
166
167 const readPasswords = async () => {
168 const newpassword = await readUserInfo.password('New password: ')
169 const confirmedpassword = await readUserInfo.password(' Again: ')
170
171 if (newpassword !== confirmedpassword) {
172 log.warn('profile', 'Passwords do not match, please try again.')
173 return readPasswords()
174 }
175
176 return newpassword
177 }
178
179 if (prop !== 'password' && value === null) {
180 throw new Error('npm profile set <prop> <value>')

Callers

nothing calls this directly

Calls 2

passwordMethod · 0.80
warnMethod · 0.80

Tested by

no test coverage detected