{"id":14035986,"url":"https://github.com/ariya/uainfer","last_synced_at":"2025-06-25T21:35:46.988Z","repository":{"id":57384304,"uuid":"151802364","full_name":"ariya/uainfer","owner":"ariya","description":"Infer the user agent from its User Agent string","archived":false,"fork":false,"pushed_at":"2022-11-28T05:45:29.000Z","size":33,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T00:05:09.462Z","etag":null,"topics":["browser","javascript","nodejs","user-agent","user-agent-parser","useragent"],"latest_commit_sha":null,"homepage":"https://ariya.github.io/uainfer","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ariya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"ariya"}},"created_at":"2018-10-06T03:44:52.000Z","updated_at":"2022-11-23T17:33:05.000Z","dependencies_parsed_at":"2023-01-23T16:00:58.705Z","dependency_job_id":null,"html_url":"https://github.com/ariya/uainfer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ariya/uainfer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariya%2Fuainfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariya%2Fuainfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariya%2Fuainfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariya%2Fuainfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ariya","download_url":"https://codeload.github.com/ariya/uainfer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ariya%2Fuainfer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261958024,"owners_count":23236384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","javascript","nodejs","user-agent","user-agent-parser","useragent"],"created_at":"2024-08-12T03:01:47.625Z","updated_at":"2025-06-25T21:35:46.960Z","avatar_url":"https://github.com/ariya.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ariya"],"categories":["JavaScript"],"sub_categories":[],"readme":"# uainfer\n\n[![npm version](https://img.shields.io/npm/v/uainfer)](https://www.npmjs.com/package/uainfer)\n[![npm bundle size (minified)](https://img.shields.io/bundlephobia/min/uainfer.svg)](https://bundlephobia.com/result?p=uainfer)\n[![GitHub license](https://img.shields.io/github/license/ariya/tebakmasa)](https://github.com/ariya/uainfer/blob/master/LICENSE)\n[![Tests](https://github.com/ariya/tebakmasa/workflows/Tests/badge.svg)](https://github.com/ariya/uainfer/actions)\n\nThis is a simple JavaScript library to infer the user agent from its claimed [User-Agent string](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent). The objective of uainfer to provide a human-friendly answer to the inquiry _\"What browser am I using?\"_.\n\nIn the context of a web browser, the most common way to obtain the User-Agent string is from [the value](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorID/userAgent) of `navigator.userAgent`. In the context of an HTTP server, it can be retrieved from the `User-Agent` header field in the HTTP request.\n\nExample usage with Node.js REPL (or [![try it on RunKit](https://badge.runkitcdn.com/uainfer.svg)](https://npm.runkit.com/uainfer)):\n\n```js\n\u003e uainfer = require('uainfer');\n\u003e claim = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2';\n\u003e ua = uainfer.analyze(claim);\n\u003e ua.toString()\n'Internet Explorer 7 on Windows XP'\n```\n\n(To use this library in a front-end application, see this [JSFiddle demo](http://jsfiddle.net/5467k1tp/))\n\nFor browsers utilizing Chrome/Blink engine (Samsung Browser, Opera, Vivaldi, etc), the result can contain the corresponding equivalent version of Chrome:\n\n```js\n\u003e console.log(ua)\nUserAgent {\n  browser:\n   { name: 'Vivaldi',\n     version: 1.96,\n     fullVersion: '1.96.1147.52',\n     chromeFamily: { version: 65, fullVersion: '65.0.3325.183' } },\n  os: { name: 'Windows', version: '10' } }\n```\n\nNon-goals:\n* Recognize every single web browsers and obscure user agents out there.\n* Deduce other information such as CPU type, device, form factor, etc.\n\nDesign choices:\n* For a better maintenance, avoid regular expressions.\n* Always expand its small but fairly extensive test suite.\n* Keep it tidy and lightweight ![npm bundle size (minified)](https://img.shields.io/bundlephobia/min/uainfer.svg)\n\nThis library is created and maintained by [@AriyaHidayat](https://twitter.com/AriyaHidayat).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariya%2Fuainfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fariya%2Fuainfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fariya%2Fuainfer/lists"}