2.1.0 • Published 2 years ago

credentials-by-uri v2.1.0

Weekly downloads
1,408
License
MIT
Repository
github
Last release
2 years ago

credentials-by-uri

npm version Status

Gets credentials for URI from npm configs

Install

pnpm add credentials-by-uri

Usage

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 }

Related

License

MIT

2.1.0

2 years ago

2.0.0-0

4 years ago

2.0.0

4 years ago

1.0.0

7 years ago