Socket
Socket
Sign inDemoInstall

ua-parser-js

Package Overview
Dependencies
0
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ua-parser-js

Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment


Version published
Weekly downloads
12M
increased by1.28%
Maintainers
1
Created
Weekly downloads
 

Package description

What is ua-parser-js?

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.

What are ua-parser-js's main functionalities?

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);

Other packages similar to ua-parser-js

Changelog

Source

Version 2.0.0-beta.2

  • Increase UA_MAX_LENGTH to 500
  • Add TypeScript declaration file in ua-parser-js/extensions submodule
  • Improve TypeScript module resolution
  • Add new methods in ua-parser-js/helpers submodule: isAppleSilicon() & isChromiumBased()
  • Fix misidentified WebView token as device model
  • Add new browser: Alipay, Klarna, Opera GX, Smart Lenovo Browser, Vivo Browser
  • Rename browser: Avant, Baidu, Samsung Internet, Sogou Explorer, Sogou Mobile, WeChat
  • Improve client-hints detection: Edge, Xbox

Readme

Source

UAParser.js

The most comprehensive, compact, & up-to-date 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).

License Options

Open-Source EditionsPRO / Commercial Editions
License optionsMITAGPLPRO PersonalPRO BusinessPRO Enterprise
Browser detection⚠️
CPU detection⚠️
Device detection⚠️
Engine detection⚠️
OS detection⚠️
Enhanced detection⛔️
Client Hints support⛔️
Extras (Apps, Bots, Libs, Emails, Media Players, etc)⛔️
CommonJS support
ES modules support⛔️
npm module available
TypeScript declarations available⚠️
Allowed for commercial use⛔️
Permissive (non-copyleft) license⛔️
Unlimited use per 1 license⚠️
1-year support⛔️⛔️
Lifetime updates
PriceFREEFREE$12$25$500
GET THE PRO PACKAGES 📥

Version 2.0

Before upgrading from v0.7 / v1.0, please read CHANGELOG to see what's new & breaking.

Documentation

Development

Contributors

Large or small, your contribution is valuable here. Please read CONTRIBUTING guide first for the instruction details.

Made with contributors-img.

Backers & Sponsors

Keywords

FAQs

Last updated on 01 Feb 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc