A simple parser for HTTP Accept-Language headers in Node.js. Version 1.0.4 (last released in 2016) extracts the first language or all language ranges from a header string. Returns objects with 'language' and 'locale' fields. Unlike more modern alternatives like 'accept-language-parser', this package has limited features, no TypeScript support, and is unmaintained. It was originally published under the npm name 'parse-acc-lang' (now deprecated) and later republished as 'acc-lang-parser'.
npm install acc-lang-parserVerified import paths — ran on the pinned version, not inferred.
Parses an Accept-Language header to get the first language and all languages.
Use require('parse-acc-lang') in code, not require('acc-lang-parser').Create your own .d.ts file or use a modern alternative with TypeScript support.
Check for empty locale string before use.
Use a more complete parser like 'accept-language-parser' if you need quality weighting.
Use require('parse-acc-lang') in your code, even though the npm package name is 'acc-lang-parser'.Ensure you require('parse-acc-lang') and that the module exports the correct functions.Pass a valid Accept-Language header string. For null/undefined, manually handle or return a default.
No dependency data recorded yet.