{"name":"registry-auth-token","version":"4.2.1","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":"e7672ad9dfdc33edc2031e02946aa11878c1b01a","_id":"registry-auth-token@4.2.1","_nodeVersion":"10.20.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==","shasum":"6d7b4006441918972ccd5fedcd41dc322c79b250","tarball":"http://registry-npm.ywwl.com/registry-auth-token/download/registry-auth-token-4.2.1.tgz","fileCount":7,"unpackedSize":11720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqotiCRA9TVsSAnZWagAA18cP/2tk+a1w9LI9Z/EI+Fb2\nsSgztRaaf4p5bv9239WujJU34nucCwfuQ/6yY/TCdmg03G2eTjDisGp95uOy\n+OImhPGYy7CuML0qpncw1ZtG5/GMjmkLGz5QZAI2yQySov9T2EFgdJtLwfxr\nbeFrMAS47uAggXiTcmjSCzuVcDW/JI38hGxzNdVnhbpSwTU0U6aI55sFlCC4\nMmXwRczgrpeB5aHFHEZ4PLDni3S9YFThFa1n3xlZrCPR8g2RLNz3hUuwh12g\nxf8OOVt45rgSdcFLiwgVSoHQc/I8B9XbtcJreKQlYrL7vMI7d1DJSXBwq4Es\njHgjUgA0iyXvp+pQ2nJKVwJZzRC6QtyEVOBkZzti9OAWBVc1H5yFpTwSG9ky\n+GdKU4dt853KHXlbXaeKvo6rtsfSlFI4hK3F62jH597/GNW4osU5yGwzqJVG\nBU0cgDlEIk2QBLklDs76TEQMMzRGKWiQEAd7ygAGZ1fkqijlEPaym9ShahTp\nr1U6gB4Y0I+GgHNi9vEy3GU3YoxgbqOg00mRtcBCCLcZQkCUaOg/jUbeMlQt\n2RaQWUcptwtEbL5qgrpq0I77t7py4TuGJjw+aH6aeSRYmZ3puDOnqXQt5xZB\ngsf3F6LnudWncI5uXVzetTND4N20yg+S/MH8bLLEzKzmOy6t4hHHVkju1ko8\n1FVx\r\n=1bZE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaSVGGbfchFDXoyv+mvygd2ZEndrCpzQtjIbrzJ/8rAwIhAMlIWq3ODsgMidbK3tZ/czgohDZkpmwceMTYh8rWTtQU"}],"size":4435,"noattachment":false,"key":"/registry-auth-token/-/registry-auth-token-4.2.1.tgz"},"_npmUser":{"name":"rexxars","email":"espen@hovlandsdal.com"},"directories":{},"maintainers":[{"name":"rexxars","email":"espen@hovlandsdal.com"},{"name":"leipert","email":"git@leipert.io"},{"name":"zkochan","email":"z@kochan.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/registry-auth-token_4.2.1_1605012321887_0.027713470245813276"},"_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":1605012322017,"_cnpm_publish_time":1605012322017,"dist-tags":{"latest":"5.1.1"}}