airyland/ua-device — explained in plain English
Analysis updated 2026-08-05 · repo last pushed 2016-04-01
Build an analytics dashboard that accurately reports device breakdowns for Chinese mobile users.
Adapt website layouts or features based on detected device type and manufacturer.
Identify hardware models of visitors to understand what phones your Chinese audience uses.
| airyland/ua-device | 3imed-jaberi/cryptography-si-isamm | 3imed-jaberi/koa-isomorphic-router | |
|---|---|---|---|
| Stars | 2 | 2 | 2 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2016-04-01 | 2021-09-25 | 2021-02-06 |
| Maintenance | Dormant | Dormant | Dormant |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 1/5 | 2/5 |
| Audience | developer | researcher | developer |
Figures from each repo's GitHub metadata at analysis time.
Install via npm and pass in a user agent string, no external services or API keys required.
ua-device is a JavaScript library that takes a browser's user agent string, the line of text every browser sends to identify itself, and turns it into structured information about the visitor's device, operating system, and browser. This is useful if you're building analytics, adapting a website for different devices, or just trying to understand what hardware your users are on. Every web browser sends a user agent string when it loads a page, but these strings are messy and inconsistent. The library parses that string and returns a clean object with details like browser name and version, rendering engine, operating system, and hardware info including device type, manufacturer, and model. You pass in the raw string, and it hands you back organized data you can use in your app. What makes this project stand out is its focus on the Chinese mobile market. Many popular UA parsers were built with Western devices in mind and struggle with Chinese phone brands. The README explains that big-name libraries often only identify phone brands correctly 30-40% of the time. This library tackles problems like phones from Xiaomi appearing under multiple inconsistent names, carriers causing different UA strings for the same device, and models getting renamed across production runs. It uses pattern matching and scraped model data from a Chinese electronics database to identify brands that plain UA strings don't reveal. Someone building a Chinese-facing analytics dashboard or a product team wanting accurate device breakdowns for a domestic audience would get the most value here. The test suite reports over 3,200 sample strings with strong recognition rates across most fields, including nearly 88% for device manufacturer, a notably hard field to get right. The tradeoff is specificity. This library is purpose-built for the Chinese market and its messy UA conventions, so it's heavier on that use case than a general-purpose parser. If your users are primarily outside China, a simpler library might serve you fine. But for products serving Chinese mobile users, the extra accuracy on hardware identification is the core benefit.
A JavaScript library that parses browser user agent strings into structured device, OS, and browser info, with special accuracy for Chinese mobile phone brands that other parsers miss.
Mainly JavaScript. The stack also includes JavaScript.
Dormant — no commits in 2+ years (last push 2016-04-01).
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.