{"name":"accept-language","version":"2.0.8","keywords":["accept-language","i18n","parser"],"author":{"name":"Tingan Ho","email":"tingan87@gmail.com"},"license":"MIT","_id":"accept-language@2.0.8","homepage":"https://github.com/tinganho/node-accept-language","bugs":{"url":"https://github.com/tinganho/node-accept-language/issues"},"dist":{"shasum":"39f1ffb9469cb3642fd9b74543734b35b61c137f","tarball":"http://registry-npm.ywwl.com/accept-language/download/accept-language-2.0.8.tgz","integrity":"sha512-JgOuW3xgmHG7ohy8d7TV8os+yd2SXHu3HzyGx+6Nv5Nco5Md5YbCsHC0Bd7eK6L90VAZXkjR5VM3dZgN0w6N0g==","signatures":[{"sig":"MEQCIGM+YxRZloHYLrL5/RVqQ2xXBgfT/F6yyqEpODVO9LrMAiA/M2Wg2xeTgzv7r3Tj4JK/hx62Wf5dQIrVlAnZuVMldw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":4091,"noattachment":false,"key":"/accept-language/-/accept-language-2.0.8.tgz"},"main":"index.js","_from":".","_shasum":"39f1ffb9469cb3642fd9b74543734b35b61c137f","gitHead":"e8ff40cc242f7cb2ea52fcb007944a19bda55c36","scripts":{"test":"./binaries/test"},"_npmUser":{"name":"tinganho","email":"tingan87@gmail.com"},"repository":{"url":"git://github.com/tinganho/node-accept-language.git","type":"git"},"_npmVersion":"1.4.28","description":"HTTP Accept-Language parser for node","dependencies":{"bcp47":"^1.1.2"},"devDependencies":{"chai":"~1.9.1","mocha":"~1.18.2","sinon":"~1.9.1","sinon-chai":"~2.5.0"},"directories":{},"readme":"accept-language [![Build Status](https://travis-ci.org/tinganho/node-accept-language.png)](https://travis-ci.org/tinganho/node-accept-language)\r\n========================\r\n\r\n[![NPM](https://nodei.co/npm/accept-language.png?downloads=true&stars=true)](https://nodei.co/npm/accept-language/)\r\n\r\n`accept-language` parses HTTP Accept-Language header ([BCP47][] compliant) and returns a matched defined language.\r\n\r\n### Installation:\r\n\r\n```\r\nnpm install accept-language --save\r\n```\r\n\r\n### Usage:\r\n\r\n```ts\r\n// var acceptLanguage = require('accept-language');\r\nimport acceptLanguage from 'accept-language';\r\nacceptLanguage.languages(['en-US', 'zh-CN']);\r\nconsole.log(acceptLanguage.get('en-GB,en;q=0.8,sv'));\r\n/*\r\n\r\n'en-US'\r\n\r\n*/\r\n```\r\n\r\n### Usage with Express:\r\nIf you are using Express server please use the middleware [express-request-language](https://www.npmjs.com/package/express-request-language).\r\n\r\n### API\r\n#### acceptLanguage.languages(Array languageTags);\r\nProvide your language tags in order of priority. The language tags must comply with [BCP47][] standard.\r\n\r\n```javascript\r\nacceptLanguage.languages(['en-US', 'zh-CN']);\r\n```\r\n\r\n#### acceptLanguage.get(String acceptLanguageString);\r\nReturns the most likely language given an `Accept-Language` string. At least 1 language tag must be provided.\r\n```javascript\r\nacceptLanguage.get('en-GB,en;q=0.8,sv');\r\n```\r\n\r\n### Maintainer\r\n\r\nTingan Ho [@tingan87][]\r\n\r\n### License\r\nMIT\r\n\r\n[L10ns]: http://l10ns.org\r\n[BCP47]: https://tools.ietf.org/html/bcp47\r\n[@tingan87]: https://twitter.com/tingan87\r\n","publish_time":1424057650968,"maintainers":[{"name":"tinganho","email":"tingan87@gmail.com"}],"_cnpm_publish_time":1424057650968,"dist-tags":{"latest":"3.0.20","next":"3.0.4"}}