{"name":"registry-auth-token","version":"3.3.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"},"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.1.6","safe-buffer":"^5.0.1"},"devDependencies":{"istanbul":"^0.4.2","mocha":"^3.3.0","require-uncached":"^1.0.2","standard":"^10.0.2"},"standard":{"ignore":["coverage/**"]},"gitHead":"bc7fe19fa5fae473ea9a3da33e7504ff8b6dff37","_id":"registry-auth-token@3.3.1","_shasum":"fb0d3289ee0d9ada2cbb52af5dfe66cb070d3006","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.6.0","_npmUser":{"name":"rexxars","email":"rexxars@gmail.com"},"dist":{"shasum":"fb0d3289ee0d9ada2cbb52af5dfe66cb070d3006","tarball":"http://registry-npm.ywwl.com/registry-auth-token/download/registry-auth-token-3.3.1.tgz","integrity":"sha512-0j3fV90ia0mIIuxQ8JR57CMAcf5phrOutAFyaixVCi8GCpqEAy+6VebVfVkP7pq4Iyjpx8I7ttSkpxNnlqrD/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKtHKxcH2iQsRFoekBsUyXpj352DiUkpbAWb6fT8tUUAiAtgKRvOyeFBNJreyIkVuogg5FeMLmwK+DmMyaIGRKvOQ=="}],"size":20772,"noattachment":false,"key":"/registry-auth-token/-/registry-auth-token-3.3.1.tgz"},"maintainers":[{"name":"leipert","email":"git@leipert.io"},{"name":"rexxars","email":"rexxars@gmail.com"},{"name":"zkochan","email":"zoltan.kochan@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/registry-auth-token-3.3.1.tgz_1493755144860_0.16137066180817783"},"directories":{},"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":1493755145664,"_cnpm_publish_time":1493755145664,"dist-tags":{"latest":"5.1.1"}}