{
  "_args": [
    [
      {
        "raw": "type-is@~1.6.15",
        "scope": null,
        "escapedName": "type-is",
        "name": "type-is",
        "rawSpec": "~1.6.15",
        "spec": ">=1.6.15 <1.7.0",
        "type": "range"
      },
      "/home/travis/build/lukesargeant/ember-sparkline/node_modules/express"
    ]
  ],
  "_from": "type-is@>=1.6.15 <1.7.0",
  "_id": "type-is@1.6.15",
  "_inCache": true,
  "_location": "/type-is",
  "_nodeVersion": "4.7.3",
  "_npmOperationalInternal": {
    "host": "packages-18-east.internal.npmjs.com",
    "tmp": "tmp/type-is-1.6.15.tgz_1491016789014_0.6958203655667603"
  },
  "_npmUser": {
    "name": "dougwilson",
    "email": "doug@somethingdoug.com"
  },
  "_npmVersion": "2.15.11",
  "_phantomChildren": {},
  "_requested": {
    "raw": "type-is@~1.6.15",
    "scope": null,
    "escapedName": "type-is",
    "name": "type-is",
    "rawSpec": "~1.6.15",
    "spec": ">=1.6.15 <1.7.0",
    "type": "range"
  },
  "_requiredBy": [
    "/body-parser",
    "/express"
  ],
  "_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz",
  "_shasum": "cab10fb4909e441c82842eafe1ad646c81804410",
  "_shrinkwrap": null,
  "_spec": "type-is@~1.6.15",
  "_where": "/home/travis/build/lukesargeant/ember-sparkline/node_modules/express",
  "bugs": {
    "url": "https://github.com/jshttp/type-is/issues"
  },
  "contributors": [
    {
      "name": "Douglas Christopher Wilson",
      "email": "doug@somethingdoug.com"
    },
    {
      "name": "Jonathan Ong",
      "email": "me@jongleberry.com",
      "url": "http://jongleberry.com"
    }
  ],
  "dependencies": {
    "media-typer": "0.3.0",
    "mime-types": "~2.1.15"
  },
  "description": "Infer the content-type of a request.",
  "devDependencies": {
    "eslint": "3.19.0",
    "eslint-config-standard": "7.1.0",
    "eslint-plugin-markdown": "1.0.0-beta.4",
    "eslint-plugin-promise": "3.5.0",
    "eslint-plugin-standard": "2.1.1",
    "istanbul": "0.4.5",
    "mocha": "1.21.5"
  },
  "directories": {},
  "dist": {
    "shasum": "cab10fb4909e441c82842eafe1ad646c81804410",
    "tarball": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz"
  },
  "engines": {
    "node": ">= 0.6"
  },
  "files": [
    "LICENSE",
    "HISTORY.md",
    "index.js"
  ],
  "gitHead": "9e88be851cc628364ad8842433dce32437ea4e73",
  "homepage": "https://github.com/jshttp/type-is#readme",
  "keywords": [
    "content",
    "type",
    "checking"
  ],
  "license": "MIT",
  "maintainers": [
    {
      "name": "dougwilson",
      "email": "doug@somethingdoug.com"
    },
    {
      "name": "jongleberry",
      "email": "jonathanrichardong@gmail.com"
    }
  ],
  "name": "type-is",
  "optionalDependencies": {},
  "readme": "# type-is\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\nInfer the content-type of a request.\n\n### Install\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```sh\n$ npm install type-is\n```\n\n## API\n\n```js\nvar http = require('http')\nvar typeis = require('type-is')\n\nhttp.createServer(function (req, res) {\n  var istext = typeis(req, ['text/*'])\n  res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text')\n})\n```\n\n### type = typeis(request, types)\n\n`request` is the node HTTP request. `types` is an array of types.\n\n<!-- eslint-disable no-undef -->\n\n```js\n// req.headers.content-type = 'application/json'\n\ntypeis(req, ['json'])             // 'json'\ntypeis(req, ['html', 'json'])     // 'json'\ntypeis(req, ['application/*'])    // 'application/json'\ntypeis(req, ['application/json']) // 'application/json'\n\ntypeis(req, ['html']) // false\n```\n\n### typeis.hasBody(request)\n\nReturns a Boolean if the given `request` has a body, regardless of the\n`Content-Type` header.\n\nHaving a body has no relation to how large the body is (it may be 0 bytes).\nThis is similar to how file existence works. If a body does exist, then this\nindicates that there is data to read from the Node.js request stream.\n\n<!-- eslint-disable no-undef -->\n\n```js\nif (typeis.hasBody(req)) {\n  // read the body, since there is one\n\n  req.on('data', function (chunk) {\n    // ...\n  })\n}\n```\n\n### type = typeis.is(mediaType, types)\n\n`mediaType` is the [media type](https://tools.ietf.org/html/rfc6838) string. `types` is an array of types.\n\n<!-- eslint-disable no-undef -->\n\n```js\nvar mediaType = 'application/json'\n\ntypeis.is(mediaType, ['json'])             // 'json'\ntypeis.is(mediaType, ['html', 'json'])     // 'json'\ntypeis.is(mediaType, ['application/*'])    // 'application/json'\ntypeis.is(mediaType, ['application/json']) // 'application/json'\n\ntypeis.is(mediaType, ['html']) // false\n```\n\n### Each type can be:\n\n- An extension name such as `json`. This name will be returned if matched.\n- A mime type such as `application/json`.\n- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. The full mime type will be returned if matched.\n- A suffix such as `+json`. This can be combined with a wildcard such as `*/vnd+json` or `application/*+json`. The full mime type will be returned if matched.\n\n`false` will be returned if no type matches or the content type is invalid.\n\n`null` will be returned if the request does not have a body.\n\n## Examples\n\n### Example body parser\n\n```js\nvar express = require('express')\nvar typeis = require('type-is')\n\nvar app = express()\n\napp.use(function bodyParser (req, res, next) {\n  if (!typeis.hasBody(req)) {\n    return next()\n  }\n\n  switch (typeis(req, ['urlencoded', 'json', 'multipart'])) {\n    case 'urlencoded':\n      // parse urlencoded body\n      throw new Error('implement urlencoded body parsing')\n    case 'json':\n      // parse json body\n      throw new Error('implement json body parsing')\n    case 'multipart':\n      // parse multipart body\n      throw new Error('implement multipart body parsing')\n    default:\n      // 415 error code\n      res.statusCode = 415\n      res.end()\n      break\n  }\n})\n```\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/type-is.svg\n[npm-url]: https://npmjs.org/package/type-is\n[node-version-image]: https://img.shields.io/node/v/type-is.svg\n[node-version-url]: https://nodejs.org/en/download/\n[travis-image]: https://img.shields.io/travis/jshttp/type-is/master.svg\n[travis-url]: https://travis-ci.org/jshttp/type-is\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/type-is/master.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/type-is.svg\n[downloads-url]: https://npmjs.org/package/type-is\n",
  "readmeFilename": "README.md",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/jshttp/type-is.git"
  },
  "scripts": {
    "lint": "eslint --plugin markdown --ext js,md .",
    "test": "mocha --reporter spec --check-leaks --bail test/",
    "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": "1.6.15"
}
