{
  "_args": [
    [
      {
        "raw": "basic-auth@~2.0.0",
        "scope": null,
        "escapedName": "basic-auth",
        "name": "basic-auth",
        "rawSpec": "~2.0.0",
        "spec": ">=2.0.0 <2.1.0",
        "type": "range"
      },
      "/home/travis/build/lukesargeant/ember-sparkline/node_modules/morgan"
    ]
  ],
  "_from": "basic-auth@>=2.0.0 <2.1.0",
  "_id": "basic-auth@2.0.0",
  "_inCache": true,
  "_location": "/basic-auth",
  "_nodeVersion": "6.11.1",
  "_npmOperationalInternal": {
    "host": "s3://npm-registry-packages",
    "tmp": "tmp/basic-auth-2.0.0.tgz_1505275895449_0.5881294559221715"
  },
  "_npmUser": {
    "name": "dougwilson",
    "email": "doug@somethingdoug.com"
  },
  "_npmVersion": "3.10.10",
  "_phantomChildren": {},
  "_requested": {
    "raw": "basic-auth@~2.0.0",
    "scope": null,
    "escapedName": "basic-auth",
    "name": "basic-auth",
    "rawSpec": "~2.0.0",
    "spec": ">=2.0.0 <2.1.0",
    "type": "range"
  },
  "_requiredBy": [
    "/morgan"
  ],
  "_resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz",
  "_shasum": "015db3f353e02e56377755f962742e8981e7bbba",
  "_shrinkwrap": null,
  "_spec": "basic-auth@~2.0.0",
  "_where": "/home/travis/build/lukesargeant/ember-sparkline/node_modules/morgan",
  "bugs": {
    "url": "https://github.com/jshttp/basic-auth/issues"
  },
  "dependencies": {
    "safe-buffer": "5.1.1"
  },
  "description": "node.js basic auth parser",
  "devDependencies": {
    "eslint": "3.19.0",
    "eslint-config-standard": "10.2.1",
    "eslint-plugin-import": "2.7.0",
    "eslint-plugin-markdown": "1.0.0-beta.6",
    "eslint-plugin-node": "5.1.1",
    "eslint-plugin-promise": "3.5.0",
    "eslint-plugin-standard": "3.0.1",
    "istanbul": "0.4.5",
    "mocha": "2.5.3"
  },
  "directories": {},
  "dist": {
    "shasum": "015db3f353e02e56377755f962742e8981e7bbba",
    "tarball": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz"
  },
  "engines": {
    "node": ">= 0.8"
  },
  "files": [
    "HISTORY.md",
    "LICENSE",
    "index.js"
  ],
  "gitHead": "704457317b54809b750274cc794d05d43cbb190c",
  "homepage": "https://github.com/jshttp/basic-auth#readme",
  "keywords": [
    "basic",
    "auth",
    "authorization",
    "basicauth"
  ],
  "license": "MIT",
  "maintainers": [
    {
      "name": "tjholowaychuk",
      "email": "tj@vision-media.ca"
    },
    {
      "name": "jonathanong",
      "email": "jonathanrichardong@gmail.com"
    },
    {
      "name": "dougwilson",
      "email": "doug@somethingdoug.com"
    },
    {
      "name": "jongleberry",
      "email": "jonathanrichardong@gmail.com"
    }
  ],
  "name": "basic-auth",
  "optionalDependencies": {},
  "readme": "# basic-auth\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nGeneric basic auth Authorization header field parser for whatever.\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/). Installation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```\n$ npm install basic-auth\n```\n\n## API\n\n<!-- eslint-disable no-unused-vars -->\n\n```js\nvar auth = require('basic-auth')\n```\n\n### auth(req)\n\nGet the basic auth credentials from the given request. The `Authorization`\nheader is parsed and if the header is invalid, `undefined` is returned,\notherwise an object with `name` and `pass` properties.\n\n### auth.parse(string)\n\nParse a basic auth authorization header string. This will return an object\nwith `name` and `pass` properties, or `undefined` if the string is invalid.\n\n## Example\n\nPass a Node.js request object to the module export. If parsing fails\n`undefined` is returned, otherwise an object with `.name` and `.pass`.\n\n<!-- eslint-disable no-unused-vars, no-undef -->\n\n```js\nvar auth = require('basic-auth')\nvar user = auth(req)\n// => { name: 'something', pass: 'whatever' }\n```\n\nA header string from any other location can also be parsed with\n`auth.parse`, for example a `Proxy-Authorization` header:\n\n<!-- eslint-disable no-unused-vars, no-undef -->\n\n```js\nvar auth = require('basic-auth')\nvar user = auth.parse(req.getHeader('Proxy-Authorization'))\n```\n\n### With vanilla node.js http server\n\n```js\nvar http = require('http')\nvar auth = require('basic-auth')\n\n// Create server\nvar server = http.createServer(function (req, res) {\n  var credentials = auth(req)\n\n  if (!credentials || credentials.name !== 'john' || credentials.pass !== 'secret') {\n    res.statusCode = 401\n    res.setHeader('WWW-Authenticate', 'Basic realm=\"example\"')\n    res.end('Access denied')\n  } else {\n    res.end('Access granted')\n  }\n})\n\n// Listen\nserver.listen(3000)\n```\n\n# License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/basic-auth.svg\n[npm-url]: https://npmjs.org/package/basic-auth\n[node-version-image]: https://img.shields.io/node/v/basic-auth.svg\n[node-version-url]: https://nodejs.org/en/download\n[travis-image]: https://img.shields.io/travis/jshttp/basic-auth/master.svg\n[travis-url]: https://travis-ci.org/jshttp/basic-auth\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/basic-auth/master.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/basic-auth?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/basic-auth.svg\n[downloads-url]: https://npmjs.org/package/basic-auth\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jshttp/basic-auth.git"
  },
  "scripts": {
    "lint": "eslint --plugin markdown --ext js,md .",
    "test": "mocha --check-leaks --reporter spec --bail",
    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
  },
  "version": "2.0.0"
}
