$ npm install credentials-by-uri
Gets credentials for URI from npm configs
pnpm add credentials-by-uri
const credentialsByUri = require('credentials-by-uri')
const config = {
registry: 'https://registry.npmjs.com',
'//registry.com/:_authToken': 'f23jj93f32dsaf==',
'//registry.com/:always-auth': 'false'
}
console.log(
credentialsByUri(config, 'https://registry.com')
)
> { authHeaderValue: 'Bearer f23jj93f32dsaf==', alwaysAuth: false }
© 2010 - cnpmjs.org x YWFE | Home | YWFE