{
  "name": "negotiator",
  "description": "HTTP content negotiation",
  "version": "0.3.0",
  "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.6.x"
  },
  "scripts": {
    "test": "nodeunit test"
  },
  "optionalDependencies": {},
  "engines": {
    "node": "*"
  },
  "main": "lib/negotiator.js",
  "readme": "# 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.preferredMediaTypes()\n    // -> ['text/html', 'image/jpeg', 'application/*']\n\n    negotiator.preferredMediaTypes(availableMediaTypes)\n    // -> ['text/html', 'application/json']\n\n    negotiator.preferredMediaType(availableMediaTypes)\n    // -> 'text/html'\n\nYou can check a working example at `examples/accept.js`.\n\n## Methods\n\n`preferredMediaTypes(availableMediaTypes)`:\n\nReturns an array of preferred media types ordered by priority from a list of available media types.\n\n`preferredMediaType(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.preferredLanguages()\n    // -> ['es', 'pt', 'en']\n\n    negotiator.preferredLanguages(availableLanguages)\n    // -> ['es', 'en']\n\n    language = negotiator.preferredLanguage(availableLanguages)\n    // -> 'es'\n\nYou can check a working example at `examples/language.js`.\n\n## Methods\n\n`preferredLanguages(availableLanguages)`:\n\nReturns an array of preferred languages ordered by priority from a list of available languages.\n\n`preferredLanguage(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.preferredCharsets()\n    // -> ['utf-8', 'iso-8859-1', 'utf-7']\n\n    negotiator.preferredCharsets(availableCharsets)\n    // -> ['utf-8', 'iso-8859-1']\n\n    negotiator.preferredCharset(availableCharsets)\n    // -> 'utf-8'\n\nYou can check a working example at `examples/charset.js`.\n\n## Methods\n\n`preferredCharsets(availableCharsets)`:\n\nReturns an array of preferred charsets ordered by priority from a list of available charsets.\n\n`preferredCharset(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.preferredEncodings()\n    // -> ['gzip', 'identity', 'compress']\n\n    negotiator.preferredEncodings(availableEncodings)\n    // -> ['gzip', 'identity']\n\n    negotiator.preferredEncoding(availableEncodings)\n    // -> 'gzip'\n\nYou can check a working example at `examples/encoding.js`.\n\n## Methods\n\n`preferredEncodings(availableEncodings)`:\n\nReturns an array of preferred encodings ordered by priority from a list of available encodings.\n\n`preferredEncoding(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.3.0",
  "_from": "negotiator@0.3.0"
}
