{
  "name": "negotiator",
  "description": "HTTP content negotiation",
  "version": "0.4.3",
  "author": {
    "name": "Federico Romero",
    "email": "federico.romero@outboxlabs.com"
  },
  "contributors": [
    {
      "name": "Isaac Z. Schlueter",
      "email": "i@izs.me",
      "url": "http://blog.izs.me/"
    }
  ],
  "repository": {
    "type": "git",
    "url": "git://github.com/federomero/negotiator.git"
  },
  "keywords": [
    "http",
    "content negotiation",
    "accept",
    "accept-language",
    "accept-encoding",
    "accept-charset"
  ],
  "engine": "node >= 0.6",
  "license": "MIT",
  "devDependencies": {
    "nodeunit": "0.8.x"
  },
  "scripts": {
    "test": "nodeunit test"
  },
  "optionalDependencies": {},
  "engines": {
    "node": "*"
  },
  "main": "lib/negotiator.js",
  "readme": "# Negotiator [![Build Status](https://travis-ci.org/federomero/negotiator.png)](https://travis-ci.org/federomero/negotiator)\n\nAn HTTP content negotiator for node.js written in javascript.\n\n# Accept Negotiation\n\n    Negotiator = require('negotiator')\n\n    availableMediaTypes = ['text/html', 'text/plain', 'application/json']\n\n    // The negotiator constructor receives a request object\n    negotiator = new Negotiator(request)\n\n    // Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8'\n\n    negotiator.mediaTypes()\n    // -> ['text/html', 'image/jpeg', 'application/*']\n\n    negotiator.mediaTypes(availableMediaTypes)\n    // -> ['text/html', 'application/json']\n\n    negotiator.mediaType(availableMediaTypes)\n    // -> 'text/html'\n\nYou can check a working example at `examples/accept.js`.\n\n## Methods\n\n`mediaTypes(availableMediaTypes)`:\n\nReturns an array of preferred media types ordered by priority from a list of available media types.\n\n`mediaType(availableMediaType)`:\n\nReturns the top preferred media type from a list of available media types.\n\n# Accept-Language Negotiation\n\n    Negotiator = require('negotiator')\n\n    negotiator = new Negotiator(request)\n\n    availableLanguages = 'en', 'es', 'fr'\n\n    // Let's say Accept-Language header is 'en;q=0.8, es, pt'\n\n    negotiator.languages()\n    // -> ['es', 'pt', 'en']\n\n    negotiator.languages(availableLanguages)\n    // -> ['es', 'en']\n\n    language = negotiator.language(availableLanguages)\n    // -> 'es'\n\nYou can check a working example at `examples/language.js`.\n\n## Methods\n\n`languages(availableLanguages)`:\n\nReturns an array of preferred languages ordered by priority from a list of available languages.\n\n`language(availableLanguages)`:\n\nReturns the top preferred language from a list of available languages.\n\n# Accept-Charset Negotiation\n\n    Negotiator = require('negotiator')\n\n    availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5']\n\n    negotiator = new Negotiator(request)\n\n    // Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2'\n\n    negotiator.charsets()\n    // -> ['utf-8', 'iso-8859-1', 'utf-7']\n\n    negotiator.charsets(availableCharsets)\n    // -> ['utf-8', 'iso-8859-1']\n\n    negotiator.charset(availableCharsets)\n    // -> 'utf-8'\n\nYou can check a working example at `examples/charset.js`.\n\n## Methods\n\n`charsets(availableCharsets)`:\n\nReturns an array of preferred charsets ordered by priority from a list of available charsets.\n\n`charset(availableCharsets)`:\n\nReturns the top preferred charset from a list of available charsets.\n\n# Accept-Encoding Negotiation\n\n    Negotiator = require('negotiator').Negotiator\n\n    availableEncodings = ['identity', 'gzip']\n\n    negotiator = new Negotiator(request)\n\n    // Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5'\n\n    negotiator.encodings()\n    // -> ['gzip', 'identity', 'compress']\n\n    negotiator.encodings(availableEncodings)\n    // -> ['gzip', 'identity']\n\n    negotiator.encoding(availableEncodings)\n    // -> 'gzip'\n\nYou can check a working example at `examples/encoding.js`.\n\n## Methods\n\n`encodings(availableEncodings)`:\n\nReturns an array of preferred encodings ordered by priority from a list of available encodings.\n\n`encoding(availableEncodings)`:\n\nReturns the top preferred encoding from a list of available encodings.\n\n# License\n\nMIT\n",
  "readmeFilename": "readme.md",
  "bugs": {
    "url": "https://github.com/federomero/negotiator/issues"
  },
  "homepage": "https://github.com/federomero/negotiator",
  "dependencies": {},
  "_id": "negotiator@0.4.3",
  "_from": "negotiator@0.4.3"
}
