Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ua-parser

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ua-parser

A port of Browserscope's user agent parser.

  • 0.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-46.77%
Maintainers
1
Weekly downloads
 
Created
Source

ua-parser

ua-parser is a port to node.js of BrowserScope's user agent string parser.

The crux of the original parser--the data collected by Steve Souders over the years--has been extracted into a separate JSON file so as to be reusable as is by implementations in other programming languages.

ua-parser is just a small wrapper around this data.

Usage

var uaParser = require('ua-parser');
var ua = uaParser.parse(navigator.userAgent);

console.log(ua.tostring());
// -> "Safari 5.0.1"

console.log(ua.toVersionString());
// -> "5.0.1"

console.log(ua.toFullString());
// -> "Safari 5.0.1/Mac OS X"

console.log(ua.family);
// -> "Safari"

console.log(ua.major);
// -> 5

console.log(ua.minor);
// -> 0

console.log(ua.patch);
// -> 1

console.log(ua.os);
// -> Mac OS X

License

Your choice of MIT or Apache License, Version 2.0 for the JS code which is Copyright 2010 Tobie Langel.

The data contained in regexes.json is Copyright 2009 Google Inc. and available under the Apache License, Version 2.0.

FAQs

Package last updated on 09 Aug 2011

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc