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

user-agent-parse

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

user-agent-parse

simple, no deps browser user-agent string parser

  • 0.1.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
255
increased by2.82%
Maintainers
1
Weekly downloads
 
Created
Source

Node User Agent Parse

Very simple, no deps user agent string parser.

NPM

Build Status

Build Status

Overview

Parse user agents a bit like PHP's get_browser(). Rudimentary but it works.

Example

     const userAgent = require('user-agent');
     userAgent.parse('Mozilla/5.0 (Windows; U; Windows NT 5.1; en) AppleWebKit/526.9 (KHTML, like Gecko) Version/4.0dp1 Safari/526.8');
     // => { name: 'safari', version: '4.0dp1', os: 'Windows XP', full: '... same string as above ...', device_type:'desktop' }

Tests

See '/test/test.js` for a simple suite

Credits

Heavily based on (blatantly ripped from ahem) https://github.com/soldair/node-ua-device-type and https://github.com/jujhars13/node-user-agent-parse

TODO

Implemnet tests using mocha and should

License

License is MIT, go nuts.

Keywords

FAQs

Package last updated on 18 Nov 2019

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