Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
ua-parser-js
Advanced tools
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment
The ua-parser-js package is a utility for parsing user agent strings. It can be used to extract detailed information about the browser, engine, OS, CPU, and device from the user agent string provided by the client's browser.
Browser Detection
This feature allows you to detect the browser name and version from the user agent string.
const UAParser = require('ua-parser-js');
const parser = new UAParser();
const browser = parser.getBrowser();
console.log(browser);
Operating System Detection
This feature enables you to determine the operating system and its version from the user agent string.
const UAParser = require('ua-parser-js');
const parser = new UAParser();
const os = parser.getOS();
console.log(os);
Device Detection
With this feature, you can identify the device type, vendor, and model from the user agent string.
const UAParser = require('ua-parser-js');
const parser = new UAParser();
const device = parser.getDevice();
console.log(device);
Engine Detection
This feature allows you to extract the layout engine name and version from the user agent string.
const UAParser = require('ua-parser-js');
const parser = new UAParser();
const engine = parser.getEngine();
console.log(engine);
CPU Architecture Detection
This feature provides information about the CPU architecture from the user agent string.
const UAParser = require('ua-parser-js');
const parser = new UAParser();
const cpu = parser.getCPU();
console.log(cpu);
The 'device' package is another npm package that allows you to parse user agent strings to determine device type (phone, tablet, desktop, etc.). It is simpler than ua-parser-js and does not provide detailed information about browser, engine, or OS.
The 'platform' package is used for parsing and interpreting user agent strings. It provides information about the operating system, browser, and device in a structured format. It is similar to ua-parser-js but has a different API and may offer different levels of detail in the results.
Bowser is a browser detection library that is similar to ua-parser-js. It focuses on identifying browser type, version, and engine. It also provides methods to check if the browser matches certain criteria, which can be useful for feature detection and browser-specific adjustments.
The most comprehensive, compact, & up-to-date isomorphic JavaScript library to detect user's Browser, Engine, OS, CPU, and Device type/model. Runs either in browser (client-side) or node.js (server-side).
version 1.x
: https://github.com/faisalman/ua-parser-js/tree/1.0.x#documentationversion 2.x
: https://docs.uaparser.devBefore upgrading from v0.7
/ v1.0
, please read CHANGELOG to
see what's new & breaking.
Open-Source Editions | PRO / Commercial Editions | ||||
---|---|---|---|---|---|
License options | MIT (v0.7~v1.0) | AGPL (>=v2.0) | PRO Personal | PRO Business | PRO Enterprise |
Browser detection | ⚠️ | ✅ | ✅ | ✅ | ✅ |
CPU detection | ⚠️ | ✅ | ✅ | ✅ | ✅ |
Device detection | ⚠️ | ✅ | ✅ | ✅ | ✅ |
Engine detection | ⚠️ | ✅ | ✅ | ✅ | ✅ |
OS detection | ⚠️ | ✅ | ✅ | ✅ | ✅ |
Bot detection | ❌ | ✅ | ✅ | ✅ | ✅ |
AI Bot detection | ❌ | ✅ | ✅ | ✅ | ✅ |
Extras (Apps, Libs, Emails, Media Players, etc) detection | ❌ | ✅ | ✅ | ✅ | ✅ |
Enhanced detection result | ❌ | ✅ | ✅ | ✅ | ✅ |
Client Hints support | ❌ | ✅ | ✅ | ✅ | ✅ |
CommonJS support | ✅ | ✅ | ✅ | ✅ | ✅ |
ES modules support | ❌ | ✅ | ✅ | ✅ | ✅ |
npm module | ✅ | ✅ | ✅ | ✅ | ✅ |
TypeScript declarations | ⚠️ | ✅ | ✅ | ✅ | ✅ |
Allows commercial use | ✅ | ✅ | ❌ | ✅ | ✅ |
Permissive (non-copyleft) license | ✅ | ❌ | ✅ | ✅ | ✅ |
Unlimited use per 1 license | ✅ | ✅ | ✅ | ❌ | ✅ |
1-year product support | ❌ | ❌ | ✅ | ✅ | ✅ |
Lifetime updates | ✅ | ✅ | ✅ | ✅ | ✅ |
Price | FREE (License) | FREE (License) | $14 (License) | $29 (License) | $599 (License) |
GET THE PRO PACKAGES 📥 |
Please read CONTRIBUTING guide first for the instruction details.
Made with contributors-img.
Support the open-source editions of UAParser.js on OpenCollective or GitHub Sponsors.
Version 2.0.0
ua-parser-js/extensions
submodule:
ua-parser-js/helpers
submodule:
isAIBot()
: Checks if the user-agent is an AI botFAQs
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment
The npm package ua-parser-js receives a total of 10,807,526 weekly downloads. As such, ua-parser-js popularity was classified as popular.
We found that ua-parser-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.