Subtag Language Tag Parser
JSON →The `subtag` library, currently at version 0.5.0 (last updated March 2017), provides a lightweight utility for parsing BCP 47 language tags (e.g., `en-US`, `zh-Hant-HK`) into their constituent components like language, extended language, script, and region. It offers methods to parse a tag into a structured object, an array of subtags, or extract individual subtags directly. The parsing logic is implemented using regular expressions, making it efficient for common use cases but it does not perform comprehensive validation against the full IANA language subtag registry. This package differentiates itself through its simplicity and focused parsing capabilities. It supports both Node.js and ES5+ browsers, though its unmaintained status means it may not be suitable for modern applications requiring full BCP 47 compliance or active support.
Traffic · last 30 days ↓100% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany