{
  "name": "accepts",
  "description": "Higher-level content negotiation",
  "version": "1.1.0",
  "author": {
    "name": "Jonathan Ong",
    "email": "me@jongleberry.com",
    "url": "http://jongleberry.com"
  },
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git://github.com/jshttp/accepts"
  },
  "dependencies": {
    "mime-types": "~2.0.0",
    "negotiator": "0.4.7"
  },
  "devDependencies": {
    "istanbul": "~0.3.0",
    "mocha": "1",
    "should": "4"
  },
  "engines": {
    "node": ">= 0.8.0"
  },
  "scripts": {
    "test": "mocha --require should --reporter dot test/",
    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require should --reporter dot test/",
    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require should --reporter spec test/"
  },
  "keywords": [
    "content",
    "negotiation",
    "accept",
    "accepts"
  ],
  "files": [
    "index.js"
  ],
  "readme": "# Accepts\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![Dependency Status][david-image]][david-url]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\nHigher level content negotation based on [negotiator](https://github.com/federomero/negotiator). Extracted from [koa](https://github.com/koajs/koa) for general use.\n\nIn addition to negotatior, it allows:\n\n- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` as well as `('text/html', 'application/json')`.\n- Allows type shorthands such as `json`.\n- Returns `false` when no types match\n- Treats non-existent headers as `*`\n\n## API\n\n### var accept = new Accepts(req)\n\n```js\nvar accepts = require('accepts')\n\nhttp.createServer(function (req, res) {\n  var accept = accepts(req)\n})\n```\n\n### accept\\[property\\]\\(\\)\n\nReturns all the explicitly accepted content property as an array in descending priority.\n\n- `accept.types()`\n- `accept.encodings()`\n- `accept.charsets()`\n- `accept.languages()`\n\nThey are also aliased in singular form such as `accept.type()`. `accept.languages()` is also aliased as `accept.langs()`, etc.\n\nNote: you should almost never do this in a real app as it defeats the purpose of content negotiation.\n\nExample:\n\n```js\n// in Google Chrome\nvar encodings = accept.encodings() // -> ['sdch', 'gzip', 'deflate']\n```\n\nSince you probably don't support `sdch`, you should just supply the encodings you support:\n\n```js\nvar encoding = accept.encodings('gzip', 'deflate') // -> 'gzip', probably\n```\n\n### accept\\[property\\]\\(values, ...\\)\n\nYou can either have `values` be an array or have an argument list of values.\n\nIf the client does not accept any `values`, `false` will be returned.\nIf the client accepts any `values`, the preferred `value` will be return.\n\nFor `accept.types()`, shorthand mime types are allowed.\n\nExample:\n\n```js\n// req.headers.accept = 'application/json'\n\naccept.types('json') // -> 'json'\naccept.types('html', 'json') // -> 'json'\naccept.types('html') // -> false\n\n// req.headers.accept = ''\n// which is equivalent to `*`\n\naccept.types() // -> [], no explicit types\naccept.types('text/html', 'text/json') // -> 'text/html', since it was first\n```\n\n[npm-image]: https://img.shields.io/npm/v/accepts.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/accepts\n[github-tag]: http://img.shields.io/github/tag/jshttp/accepts.svg?style=flat-square\n[github-url]: https://github.com/jshttp/accepts/tags\n[travis-image]: https://img.shields.io/travis/jshttp/accepts.svg?style=flat-square\n[travis-url]: https://travis-ci.org/jshttp/accepts\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master\n[david-image]: http://img.shields.io/david/jshttp/accepts.svg?style=flat-square\n[david-url]: https://david-dm.org/jshttp/accepts\n[license-image]: http://img.shields.io/npm/l/accepts.svg?style=flat-square\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/accepts.svg?style=flat-square\n[downloads-url]: https://npmjs.org/package/accepts\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/jshttp/accepts/issues"
  },
  "_id": "accepts@1.1.0",
  "_from": "accepts@~1.1.0"
}
