{"name":"registry-auth-token","version":"4.2.0","description":"Get the auth token set for an npm registry (if any)","main":"index.js","scripts":{"test":"mocha","posttest":"standard","coverage":"istanbul cover _mocha"},"repository":{"type":"git","url":"git+ssh://git@github.com/rexxars/registry-auth-token.git"},"engines":{"node":">=6.0.0"},"keywords":["npm","conf","config","npmconf","registry","auth","token","authtoken"],"author":{"name":"Espen Hovlandsdal","email":"espen@hovlandsdal.com"},"license":"MIT","bugs":{"url":"https://github.com/rexxars/registry-auth-token/issues"},"homepage":"https://github.com/rexxars/registry-auth-token#readme","dependencies":{"rc":"^1.2.8"},"devDependencies":{"istanbul":"^0.4.2","mocha":"^6.1.4","require-uncached":"^1.0.2","standard":"^12.0.1"},"standard":{"ignore":["coverage/**"]},"gitHead":"7f639532a5a08bb648658181f3ed6072c465270b","_id":"registry-auth-token@4.2.0","_nodeVersion":"14.4.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w==","shasum":"1d37dffda72bbecd0f581e4715540213a65eb7da","tarball":"http://registry-npm.ywwl.com/registry-auth-token/download/registry-auth-token-4.2.0.tgz","fileCount":9,"unpackedSize":32419,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDEZ4CRA9TVsSAnZWagAAUKsP/3rGfvomkNenYo5iPvrl\nE84EWti6FvcU+LVxEhzoPfd3t1QRg//KxO3pPI8Wqk8/gn+3w+WgSyr8BNYX\nntwdz7ZZQJIezXoZuKaAn2WHo+T7iAibb49Nbq2O20/mejJaJ1Pmvggp+3L1\nqis3+FZgvdw4KHKES07SXFbziAyj9pls2Yvh3rEJs3CrTrzfbYbhm4GfebOg\nrs5P/jEnLHppM4SHTVBjGAibqGGwWveFwo6k3rWp4SAfpPO0Q/IdUAI+OvDa\nQAJdOgKyHZX0VpMYOerWyCE+r2AjChiE8n/26Btbbr0D5nbZ2RGHVAg26z17\nXzfEDaIsX9uPtQnJqgq0hGtG18K0yi6/oSnIKfcOa4uLXvkkaVX2R33Ia8HO\niv4b/Kw/73Qb6lTs35ccHPc6w9ch6YprBC+/DVbQkV9YRhAIrSuTfgns0xPn\n1VZHS/B+zJJ/8IPFzHiq6QRPFef4YhRfq2pzujb4uFaFbFBc3Y9Y86/zufqz\nHFCNabZW8NinZbRCfztKU/hiOxUlYKpVLbQqCRwSvooFGDf5GnLbj9Ejmgnk\nyYzQAdAIDFr/PLnraLDvPCLhdtqt+qKFQTxBydLTQOzDwW8epO3D8Zg5mk5G\nw2qtgqt3mybOzd1xk5JDcIhN79V8qIKcX5jJQWgFC88m1QYxwAoxcBKI05nS\nu2GP\r\n=6qUX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1BQBq5ENHuaZrjOpiJ/6vYUtNb1Hk/WYYdoVmyaOq3QIgU4pZoA57ZyCxj2JA/Kpgnusfbb2DprfSmql+5Fnigp0="}],"size":6539,"noattachment":false,"key":"/registry-auth-token/-/registry-auth-token-4.2.0.tgz"},"maintainers":[{"name":"leipert","email":"git@leipert.io"},{"name":"rexxars","email":"rexxars@gmail.com"},{"name":"zkochan","email":"zoltan.kochan@gmail.com"}],"_npmUser":{"name":"rexxars","email":"espen@hovlandsdal.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/registry-auth-token_4.2.0_1594639992288_0.6018348674440872"},"_hasShrinkwrap":false,"readme":"# registry-auth-token\n\n[![npm version](http://img.shields.io/npm/v/registry-auth-token.svg?style=flat-square)](https://www.npmjs.com/package/registry-auth-token)[![npm](https://img.shields.io/npm/dm/registry-auth-token?style=flat-square)](https://www.npmjs.com/package/registry-auth-token)\n\nGet the auth token set for an npm registry from `.npmrc`. Also allows fetching the configured registry URL for a given npm scope.\n\n## Installing\n\n```\nnpm install --save registry-auth-token\n```\n\n## Usage\n\nReturns an object containing `token` and `type`, or `undefined` if no token can be found. `type` can be either `Bearer` or `Basic`.\n\n```js\nconst getAuthToken = require('registry-auth-token')\nconst getRegistryUrl = require('registry-auth-token/registry-url')\n\n// Get auth token and type for default `registry` set in `.npmrc`\nconsole.log(getAuthToken()) // {token: 'someToken', type: 'Bearer'}\n\n// Get auth token for a specific registry URL\nconsole.log(getAuthToken('//registry.foo.bar'))\n\n// Find the registry auth token for a given URL (with deep path):\n// If registry is at `//some.host/registry`\n// URL passed is `//some.host/registry/deep/path`\n// Will find token the closest matching path; `//some.host/registry`\nconsole.log(getAuthToken('//some.host/registry/deep/path', {recursive: true}))\n\n// Use the npm config that is passed in\nconsole.log(getAuthToken('//registry.foo.bar', {\n  npmrc: {\n    'registry': 'http://registry.foo.bar',\n    '//registry.foo.bar/:_authToken': 'qar'\n  }\n}))\n\n// Find the configured registry url for scope `@foobar`.\n// Falls back to the global registry if not defined.\nconsole.log(getRegistryUrl('@foobar'))\n\n// Use the npm config that is passed in\nconsole.log(getRegistryUrl('http://registry.foobar.eu/', {\n  'registry': 'http://registry.foobar.eu/',\n  '//registry.foobar.eu/:_authToken': 'qar'\n}))\n```\n\n## Return value\n\n```js\n// If auth info can be found:\n{token: 'someToken', type: 'Bearer'}\n\n// Or:\n{token: 'someOtherToken', type: 'Basic'}\n\n// Or, if nothing is found:\nundefined\n```\n\n## Security\n\nPlease be careful when using this. Leaking your auth token is dangerous.\n\n## License\n\nMIT © [Espen Hovlandsdal](https://espen.codes/)\n","publish_time":1594639992404,"_cnpm_publish_time":1594639992404,"dist-tags":{"latest":"5.1.1"}}