PATH:
opt
/
alt
/
alt-nodejs19
/
root
/
usr
/
lib
/
node_modules
/
npm
/
lib
/
utils
const npmFetch = require('npm-registry-fetch') module.exports = async (npm, opts) => { const { registry } = opts // First, check if we have a user/pass-based auth const creds = npm.config.getCredentialsByURI(registry) if (creds.username) { return creds.username } // No username, but we have other credentials; fetch the username from registry if (creds.token || creds.certfile && creds.keyfile) { const registryData = await npmFetch.json('/-/whoami', { ...opts }) if (typeof registryData?.username === 'string') { return registryData.username } } // At this point, even if they have a credentials object, it doesn't have a // valid token. throw Object.assign( new Error('This command requires you to be logged in.'), { code: 'ENEEDAUTH' } ) }
[-] error-message.js
[open]
[+]
..
[-] display.js
[open]
[-] validate-lockfile.js
[open]
[-] reify-finish.js
[open]
[+]
config
[-] npm-usage.js
[open]
[-] did-you-mean.js
[open]
[-] completion.sh
[open]
[-] pulse-till-done.js
[open]
[-] completion.fish
[open]
[-] read-user-info.js
[open]
[-] explain-eresolve.js
[open]
[-] audit-error.js
[open]
[-] log-shim.js
[open]
[-] get-identity.js
[open]
[-] cmd-list.js
[open]
[+]
completion
[-] auth.js
[open]
[-] tar.js
[open]
[-] explain-dep.js
[open]
[-] ansi-trim.js
[open]
[-] open-url.js
[open]
[-] replace-info.js
[open]
[-] format-bytes.js
[open]
[-] is-windows.js
[open]
[-] log-file.js
[open]
[-] update-notifier.js
[open]
[-] format-search-stream.js
[open]
[-] otplease.js
[open]
[-] open-url-prompt.js
[open]
[-] web-auth.js
[open]
[-] exit-handler.js
[open]
[-] timers.js
[open]
[-] reify-output.js
[open]
[-] ping.js
[open]
[-] queryable.js
[open]