{"_id":"http-accept","_rev":"29-42a2bd7c2741270f24cddad7b1ff0713","name":"http-accept","description":"Connect compatible middleware that parses HTTP Accept header fields","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.0":{"name":"http-accept","version":"0.1.0","description":"Connect compatible middleware that parses HTTP Accept header fields","author":{"name":"Niclas Hoyer","email":"https://github.com/niclashoyer"},"files":["lib/"],"main":"lib/Accept.js","repository":{"type":"git","url":"git://github.com/niclashoyer/accept-http.git"},"licence":"MIT","_npmUser":{"name":"niclashoyer","email":"niclas@verbugt.de"},"_id":"http-accept@0.1.0","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"5ff55ad0dac901f5a5d51a9f917688eb56c1265d","tarball":"https://registry.npmjs.org/http-accept/-/http-accept-0.1.0.tgz","integrity":"sha512-aMsfCS+6DHgIsQj5BYFDwK5NhHFaqeR6DCm9e0Vdc3VwGiao/fw+r2APdfiY6xhYwP6sdY/Hga1cPUf5iv4rrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSDVBYan1zKjEzFdhOr7dt73439IWemzImDFHXhPC9JgIhAPjj7iy6yTAD9SN5b4/YAUlZmLmu3CqNMf/596OEi8Nz"}]},"maintainers":[{"name":"niclashoyer","email":"niclas@verbugt.de"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-2":{"name":"http-accept","version":"0.1.0-2","description":"Connect compatible middleware that parses HTTP Accept header fields","author":{"name":"Niclas Hoyer","email":"https://github.com/niclashoyer"},"files":["lib/"],"main":"lib/Accept.js","repository":{"type":"git","url":"git://github.com/niclashoyer/accept-http.git"},"licence":"MIT","_npmUser":{"name":"niclashoyer","email":"niclas@verbugt.de"},"_id":"http-accept@0.1.0-2","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"4426b2a59041a715914d8e09980733e4a6f63127","tarball":"https://registry.npmjs.org/http-accept/-/http-accept-0.1.0-2.tgz","integrity":"sha512-jUEWcesqaX+NbrCKCc7hLDaWjSWmF1Qn7zC6XySJ7+XTjrql7vsupeykMEIIkszll3NbtkEU/Q8FOF9sehj9Aw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFe5RWgiNR36bzMdryu3wF7YOVGadr395CJF+iuQzUevAiEAlx3JYI1Jf1/UYlF698ytLvc9tb5677xLS2WuGDBtSTQ="}]},"maintainers":[{"name":"niclashoyer","email":"niclas@verbugt.de"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.1-1":{"name":"http-accept","version":"0.1.1-1","description":"Connect compatible middleware that parses HTTP Accept header fields","author":{"name":"Niclas Hoyer","url":"https://github.com/niclashoyer"},"contributors":[{"name":"Ben Blank","email":"ben.blank@gmail.com","url":"https://github.com/benblank"}],"files":["lib/"],"main":"lib/Accept.js","repository":{"type":"git","url":"git://github.com/niclashoyer/http-accept.git"},"licence":"MIT","_npmUser":{"name":"niclashoyer","email":"niclas@verbugt.de"},"_id":"http-accept@0.1.1-1","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.17","_defaultsLoaded":true,"dist":{"shasum":"a695b05498726877aa2b6bc7eeb85657abd4d45d","tarball":"https://registry.npmjs.org/http-accept/-/http-accept-0.1.1-1.tgz","integrity":"sha512-o5YtTrh36MSKegLqS14Vgq+ht8OLevyJnUeliRGb9EIUidfE8nXi8r+XJFGW7HPYtiRSfE7AvBmncQRnUW6AgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGGD0ZXKbArltv5i2vngwCRXyu5qHbqcbI/GLgYvu7Y4AiEAkOK+nTjluFEgmsZDrGf3piWubYXcY4V0u6Ov0wcW01k="}]},"maintainers":[{"name":"niclashoyer","email":"niclas@verbugt.de"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.1-2":{"name":"http-accept","version":"0.1.1-2","description":"Connect compatible middleware that parses HTTP Accept header fields","author":{"name":"Niclas Hoyer","url":"https://github.com/niclashoyer"},"contributors":[{"name":"Ben Blank","email":"ben.blank@gmail.com","url":"https://github.com/benblank"}],"files":["lib/"],"main":"lib/Accept.js","repository":{"type":"git","url":"git://github.com/niclashoyer/http-accept.git"},"licence":"MIT","_npmUser":{"name":"niclashoyer","email":"niclas@verbugt.de"},"_id":"http-accept@0.1.1-2","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.17","_defaultsLoaded":true,"dist":{"shasum":"ad3dbf67f92f4d988e745b8c32c810c5b0aaae8f","tarball":"https://registry.npmjs.org/http-accept/-/http-accept-0.1.1-2.tgz","integrity":"sha512-i4d+KfEABLKsYEvvikpBuiJb4X1LNkQxJ8jnvsubIlfy57ZGLTmvGPvEqN8UEcj4AZgbfwEu3vuX4zfv1+ST4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdwKPPTi4E+SZezq3IAUXLMzlUWyiIshwypNTpnUm8gwIhAIEcN9bms0NycEJzgALhp78esa5L425T97ZcIvr53F7V"}]},"maintainers":[{"name":"niclashoyer","email":"niclas@verbugt.de"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.1-3":{"name":"http-accept","version":"0.1.1-3","description":"Connect compatible middleware that parses HTTP Accept header fields","author":{"name":"Niclas Hoyer","url":"https://github.com/niclashoyer"},"contributors":[{"name":"Ben Blank","email":"ben.blank@gmail.com","url":"https://github.com/benblank"},{"name":"Fiona Schmidtke","url":"https://github.com/fisch42"}],"files":["lib/"],"main":"lib/Accept.js","repository":{"type":"git","url":"git://github.com/niclashoyer/http-accept.git"},"licence":"MIT","_id":"http-accept@0.1.1-3","dist":{"shasum":"fec082b55579c0d1ef59164ac08cc0820c56b709","tarball":"https://registry.npmjs.org/http-accept/-/http-accept-0.1.1-3.tgz","integrity":"sha512-jxqVbomKWMn+jvD76kd0g0khA4vypv2LE3/TZoiJd7W6WJmMQuzB0sqZ6W+YKB3e2mTNbxFadCADx2+DsLmu2g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFeenzXaXciQWy4SRBAAqtH8iXT61wkRtGjklZMGE03AiEAnyyD2TrxjWCwx9azqkv+myjvI8OYvCQ7PdB3hoYN4zI="}]},"maintainers":[{"name":"niclashoyer","email":"niclas@verbugt.de"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.3":{"name":"http-accept","version":"0.1.3","description":"Connect compatible middleware that parses HTTP Accept header fields","author":{"name":"Niclas Hoyer","url":"https://github.com/niclashoyer"},"contributors":[{"name":"Ben Blank","email":"ben.blank@gmail.com","url":"https://github.com/benblank"},{"name":"Fiona Schmidtke","url":"https://github.com/fisch42"}],"files":["lib/"],"main":"lib/Accept.js","repository":{"type":"git","url":"git://github.com/niclashoyer/http-accept.git"},"licence":"MIT","bugs":{"url":"https://github.com/niclashoyer/http-accept/issues"},"_id":"http-accept@0.1.3","dist":{"shasum":"9c3c0c14dd5d66b9c1a60661a30d4497554ba5e1","tarball":"https://registry.npmjs.org/http-accept/-/http-accept-0.1.3.tgz","integrity":"sha512-Xqz/Z7kV/dw5vNOFnNINTFiNH4pkLx6ImWcFoLaJJe1mM8OWRK/+jd2SvS7V0DFOPL5aVnlKZ64orCoCdGpQvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGAj3C9lgznaJFhhXnXj8XYY+1HuPr8ocP+aaMoBuS/4AiEAhMqa0vi+H1LFycSYuyiBdJdQets2DShOeWoS2UH2KnI="}]},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"niclashoyer","email":"niclas@verbugt.de"},"maintainers":[{"name":"niclashoyer","email":"niclas@verbugt.de"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.4":{"name":"http-accept","version":"0.1.4","description":"Connect compatible middleware that parses HTTP Accept header fields","author":{"name":"Niclas Hoyer","url":"https://github.com/niclashoyer"},"contributors":[{"name":"Ben Blank","email":"ben.blank@gmail.com","url":"https://github.com/benblank"},{"name":"Fiona Schmidtke","url":"https://github.com/fisch42"}],"files":["lib/"],"main":"lib/Accept.js","repository":{"type":"git","url":"git://github.com/niclashoyer/http-accept.git"},"licence":"MIT","bugs":{"url":"https://github.com/niclashoyer/http-accept/issues"},"_id":"http-accept@0.1.4","dist":{"shasum":"314dd024d5824ec7229403e5806ec8b308d821a4","tarball":"https://registry.npmjs.org/http-accept/-/http-accept-0.1.4.tgz","integrity":"sha512-xn+M6ukwjb56MtiOh2kDDvX9NDq/VerZ5drFnghsBV0WOKMeeioUtMV4AWyjyzc069bS5BrICOQIxtNoozdzbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjEn9V0Xvsan4Y1q2YEGa2b58lHjrMlYLm2YMRQrJTSAiBUX/dPHcInaIuPJSzPUWrF2X1lMEFamXo+o90D5v2bJQ=="}]},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"niclashoyer","email":"niclas@verbugt.de"},"maintainers":[{"name":"niclashoyer","email":"niclas@verbugt.de"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.5":{"name":"http-accept","version":"0.1.5","description":"Connect compatible middleware that parses HTTP Accept header fields","author":{"name":"Niclas Hoyer","url":"https://github.com/niclashoyer"},"contributors":[{"name":"Ben Blank","email":"ben.blank@gmail.com","url":"https://github.com/benblank"},{"name":"Fiona Schmidtke","url":"https://github.com/fisch42"}],"files":["lib/"],"main":"lib/Accept.js","repository":{"type":"git","url":"git://github.com/niclashoyer/http-accept.git"},"licence":"MIT","bugs":{"url":"https://github.com/niclashoyer/http-accept/issues"},"_id":"http-accept@0.1.5","dist":{"shasum":"fa9997161b51b54efb6893adc2b2f9bb398fb6a2","tarball":"https://registry.npmjs.org/http-accept/-/http-accept-0.1.5.tgz","integrity":"sha512-OVGuWuRT0u2mYF2nHu2dpcTl7XVkhdQyyN/HEehpAA/T+LP3GDLrE87PQWu8Jl9FJeNF6yrc1Z1JRiZeO0Dksg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFAlW9IhLXKSRD/HCSswISFSuLRY3Fb/qfo83nQuPkVwIhAN3OtKXy3L4NUvVKz0s6vYc0BY6YzFERvz0MjyEJgPFU"}]},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"niclashoyer","email":"niclas@verbugt.de"},"maintainers":[{"name":"niclashoyer","email":"niclas@verbugt.de"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.6":{"name":"http-accept","version":"0.1.6","description":"Connect compatible middleware that parses HTTP Accept header fields","author":{"name":"Niclas Hoyer","url":"https://github.com/niclashoyer"},"contributors":[{"name":"Ben Blank","email":"ben.blank@gmail.com","url":"https://github.com/benblank"},{"name":"Fiona Schmidtke","url":"https://github.com/fisch42"}],"files":["lib/"],"main":"lib/Accept.js","repository":{"type":"git","url":"git://github.com/niclashoyer/http-accept.git"},"licence":"MIT","bugs":{"url":"https://github.com/niclashoyer/http-accept/issues"},"_id":"http-accept@0.1.6","dist":{"shasum":"2a3369a419400a870fcf543c29ba1850a2e4eb17","tarball":"https://registry.npmjs.org/http-accept/-/http-accept-0.1.6.tgz","integrity":"sha512-LjSQ6thL4KshIi2XWXcsbALh5z3ns6Cr0bTSvEhsfZL4SZy7OMQQqlelZ9Fm12RwD4L83FCusFXEI/aqNb4+cA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIELXO9jOlVjcBZfYuFrG86SeiomYxXU4I4uRHi0pnWjzAiEA+AqnYqeW1t4fwSoU0KvFz16uizUB32vEj6cy01nA22Q="}]},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"niclashoyer","email":"niclas@verbugt.de"},"maintainers":[{"name":"niclashoyer","email":"niclas@verbugt.de"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"readme":"# Accept\n\nAccept parses all accept header fields and sorts them according to the HTTP\nspecification.\n\n## Supported Header Fields\n\n### Accept\nParsed into `req.accept.types`.\n\n### Accept-Charset\nParsed into `req.accept.charsets`.\n\n### Accept-Encoding\nParsed into `req.accept.encodings`.\n\n### Accept-Language\nParsed into `req.accept.languages`.\n\n### Accept-Ranges\nParsed into `req.accept.ranges`.\n\n## Installation\n\n```bash\nnpm install http-accept\n```\n\n## Usage\n\nJust `require 'http-accept'` and throw it into a connect compatible middlware\nstack.\n\n```coffeescript\nconnect  = require 'connect'\nhttp     = require 'http'\naccept   = require 'http-accept'\n\napp = connect()\napp.use connect.logger 'dev'\napp.use accept\napp.use (req, res) ->\n\tconsole.log req.accept\n\tres.end()\n\napp.listen 3000\n```\n\nA request from a browser on `http://localhost:3000` would print out\n\n```javascript\n{ types: \n   [ { type: 'text',\n       subtype: 'html',\n       params: {},\n       mediarange: 'text/html',\n       quality: 1 },\n     { type: 'application',\n       subtype: 'xhtml+xml',\n       params: {},\n       mediarange: 'application/xhtml+xml',\n       quality: 1 },\n     { type: 'application',\n       subtype: 'xml',\n       params: [Object],\n       mediarange: 'application/xml',\n       quality: 0.9 },\n     { type: '*',\n       subtype: '*',\n       params: [Object],\n       mediarange: '*/*',\n       quality: 0.8 } ],\n  charsets: undefined,\n  encodings: [ 'gzip', 'deflate' ],\n  languages: [ 'de-de', 'de', 'en-us', 'en' ],\n  ranges: undefined }\n```\n\nFor each header present in the request, there is also a `getBestMatch` method which will find the highest quality match amongst the supplied candidates.\n\n```coffeescript\nencoding = (req.accept.encodings?.getBestMatch [\"gzip\", \"deflate\"]) ? \"identity\"\nmediaType = req.accept.types?.getBestMatch [\"text/html\", \"application/json\" ,\"application/xml\"]\n```\n","maintainers":[{"email":"niclas@verbugt.de","name":"niclashoyer"},{"email":"doug@somethingdoug.com","name":"dougwilson"}],"time":{"modified":"2022-06-18T22:08:47.667Z","created":"2012-04-08T15:05:42.403Z","0.1.0":"2012-04-08T15:05:44.333Z","0.1.0-2":"2012-04-28T12:16:18.629Z","0.1.1-1":"2012-05-10T18:51:21.403Z","0.1.1-2":"2012-05-10T18:55:39.826Z","0.1.1-3":"2012-08-17T19:36:43.667Z","0.1.3":"2014-02-05T13:19:03.382Z","0.1.4":"2014-02-05T18:49:40.411Z","0.1.5":"2014-02-05T21:10:36.589Z","0.1.6":"2014-02-05T21:14:37.281Z"},"author":{"name":"Niclas Hoyer","url":"https://github.com/niclashoyer"},"repository":{"type":"git","url":"git://github.com/niclashoyer/http-accept.git"},"readmeFilename":"README.md","contributors":[{"name":"Ben Blank","email":"ben.blank@gmail.com","url":"https://github.com/benblank"},{"name":"Fiona Schmidtke","url":"https://github.com/fisch42"}],"bugs":{"url":"https://github.com/niclashoyer/http-accept/issues"}}