/
snap
/
node
/
11782
/
lib
/
node_modules
/
npm
/
lib
/
utils
/
/snap/node/11782/lib/node_modules/npm/lib/utils
mkdir
upload
Name
Size
Mode
Actions
audit-error.js
1045
0644
edit
dl
rm
auth.js
3291
0644
edit
dl
rm
cmd-list.js
2959
0644
edit
dl
rm
completion.fish
1596
0644
edit
dl
rm
completion.sh
1898
0755
edit
dl
rm
did-you-mean.js
1188
0644
edit
dl
rm
display.js
15749
0644
edit
dl
rm
error-message.js
15150
0644
edit
dl
rm
explain-dep.js
3648
0644
edit
dl
rm
explain-eresolve.js
2617
0644
edit
dl
rm
format-bytes.js
629
0644
edit
dl
rm
format-search-stream.js
4808
0644
edit
dl
rm
format.js
1957
0644
edit
dl
rm
get-identity.js
802
0644
edit
dl
rm
get-workspaces.js
1748
0644
edit
dl
rm
installed-deep.js
1129
0644
edit
dl
rm
installed-shallow.js
583
0644
edit
dl
rm
is-windows.js
177
0644
edit
dl
rm
log-file.js
7971
0644
edit
dl
rm
npm-usage.js
2064
0644
edit
dl
rm
open-url.js
2414
0644
edit
dl
rm
output-error.js
767
0644
edit
dl
rm
ping.js
262
0644
edit
dl
rm
queryable.js
9785
0644
edit
dl
rm
read-user-info.js
1956
0644
edit
dl
rm
reify-finish.js
886
0644
edit
dl
rm
reify-output.js
5788
0644
edit
dl
rm
sbom-cyclonedx.js
5331
0644
edit
dl
rm
sbom-spdx.js
4696
0644
edit
dl
rm
tar.js
3552
0644
edit
dl
rm
timers.js
2120
0644
edit
dl
rm
update-workspaces.js
1013
0644
edit
dl
rm
validate-lockfile.js
1023
0644
edit
dl
rm
verify-signatures.js
12226
0644
edit
dl
rm
Edit:
/snap/node/11782/lib/node_modules/npm/lib/utils/read-user-info.js
(1956B)
const { read: _read } = require('read') const userValidate = require('npm-user-validate') const { log, input } = require('proc-log') const otpPrompt = `This command requires a one-time password (OTP) from your authenticator app. Enter one below. You can also pass one on the command line by appending --otp=123456. For more information, see: https://docs.npmjs.com/getting-started/using-two-factor-authentication Enter OTP: ` const passwordPrompt = 'npm password: ' const usernamePrompt = 'npm username: ' const emailPrompt = 'email (this IS public): ' const read = (...args) => input.read(() => _read(...args)) function readOTP (msg = otpPrompt, otp, isRetry) { if (isRetry && otp && /^[\d ]+$|^[A-Fa-f0-9]{64,64}$/.test(otp)) { return otp.replace(/\s+/g, '') } return read({ prompt: msg, default: otp || '' }) .then((rOtp) => readOTP(msg, rOtp, true)) } function readPassword (msg = passwordPrompt, password, isRetry) { if (isRetry && password) { return password } return read({ prompt: msg, silent: true, default: password || '' }) .then((rPassword) => readPassword(msg, rPassword, true)) } function readUsername (msg = usernamePrompt, username, isRetry) { if (isRetry && username) { const error = userValidate.username(username) if (error) { log.warn(error.message) } else { return Promise.resolve(username.trim()) } } return read({ prompt: msg, default: username || '' }) .then((rUsername) => readUsername(msg, rUsername, true)) } function readEmail (msg = emailPrompt, email, isRetry) { if (isRetry && email) { const error = userValidate.email(email) if (error) { log.warn(error.message) } else { return email.trim() } } return read({ prompt: msg, default: email || '' }) .then((username) => readEmail(msg, username, true)) } module.exports = { otp: readOTP, password: readPassword, username: readUsername, email: readEmail, }
Save
cmd:
run