{"name":"accept-language","version":"1.0.0","keywords":["accept-language","i18n","parser"],"author":{"name":"Andy Royle","email":"ajroyle@gmail.com"},"license":"MIT","_id":"accept-language@1.0.0","homepage":"https://github.com/andyroyle/accept-language-parser","bugs":{"url":"https://github.com/andyroyle/accept-language-parser/issues"},"dist":{"shasum":"936a35e2acd7fa902e482016bd3eb02083e2be9f","tarball":"http://registry-npm.ywwl.com/accept-language/download/accept-language-1.0.0.tgz","integrity":"sha512-t5TA+8DaAOoB0ZPGswQEeJkSgRFZZZkZMlK5EO5yt3SMO33qeVJOU0TKyu2Yzq5Rl0Q1boPodhdgbD+9tNbm7Q==","signatures":[{"sig":"MEYCIQC3M24r1J9Rj3YN6BtAOEVv4floXZAEgHVwLoLxy2WL/gIhAMIC8+J5ZGXqUsMGUuJzoHEF3NlzIBpgq+LmWFry+L2f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":3575,"noattachment":false,"key":"/accept-language/-/accept-language-1.0.0.tgz"},"main":"index.js","_from":".","scripts":{"test":"grunt test"},"_npmUser":{"name":"tinganho","email":"tingan87@gmail.com"},"repository":{"url":"git://github.com/andyroyle/accept-language-parser.git","type":"git"},"_npmVersion":"1.3.21","description":"Parse the HTTP Accept-Language header","devDependencies":{"grunt":"^0.4.4","should":"^3.2.0","grunt-cli":"^0.1.13","grunt-mocha-test":"^0.10.0","grunt-contrib-jshint":"^0.9.2"},"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":1397815276107,"maintainers":[{"name":"tinganho","email":"tingan87@gmail.com"}],"_cnpm_publish_time":1397815276107,"dist-tags":{"latest":"3.0.20","next":"3.0.4"}}