Socket
Socket
Sign inDemoInstall

@anzerr/agent.util

Package Overview
Dependencies
4
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @anzerr/agent.util

Parse and fetch info found inside user-agent.


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Intro

GitHub Actions status | linter GitHub Actions status | publish GitHub Actions status | test

Parse and fetch info found inside user-agent

Install
npm install --save git+https://git@github.com/anzerr/agent.util.git
npm install --save @anzerr/agent.util

Example


const {UserAgent} = require('@anzerr/agent.util');

const u = new UserAgent();

const agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36';
console.log(u.get(agent), agent);
/*
{
  os: null,
  phone: null,
  tablet: null,
  valid: { tablet: false, phone: false },
  uas: [],
  props: [
    { key: 'Safari', version: '537.36' },
    { key: 'Webkit', version: '537.36' },
    { key: 'Chrome', version: '84.0.4147.105' },
    { key: 'Windows NT', version: '10.0' }
  ],
  utils: [ { key: 'WebKit', version: '537.36' } ]
} Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36
*/

Keywords

FAQs

Last updated on 28 Aug 2020

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc