0.2.3 • Published 9 months ago

binterly-user-agent-parser v0.2.3

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
9 months ago

User Agent Parser by Binterly

TS library to detect browser, device, OS and more from user agent string. Zero dependencies. Can be used in both Node and browser environments.

Features

:white_check_mark: The library is regularly update and maintained. \ :white_check_mark: Tested against over 26,000,000 user agents. \ :white_check_mark: Has extensive data set of browsers, devices and OS.

Methods

  • parseUA: returns full information about browser, device and OS.
  • getBrowserInfo: return browser information only - name, version and engine.

API Reference

When used in browser environment, the library will automatically get the user agent string from the browser. \ When used in Node environment, you can pass the user agent string as a parameter. \

parseUA

import { parseUA } from 'binterly-user-agent-parser';

const result = parseUA();

or

import { parseUA } from 'binterly-user-agent-parser';

const userAgent = 'Mozilla/5.0 (Linux; Android 11; SM-G991B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Mobile Safari/537.36';
const result = parseUA(userAgent);

Response

{
  "browser": {
    "name": "Chrome",
    "version": "91.0.4472.114",
    "engine": "Blink"
  },
  "os": {
    "name": "Android",
    "version": "11",
    "versionName": "Red Velvet Cake"
  },
  "device": {
    "type": "Mobile",
    "brand": "Samsung",
    "model": "Galaxy S21 5G"
  }
}

getBrowserInfo

import { getBrowserInfo } from 'binterly-user-agent-parser';

const result = getBrowserInfo();

Response

{
  "name": "Chrome",
  "version": "91.0.4472.114",
  "engine": "Blink"
}
0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.1.19

9 months ago

0.1.18

9 months ago

0.1.17

9 months ago

0.1.16

9 months ago

0.1.15

9 months ago

0.1.14

9 months ago

0.1.13

9 months ago

0.1.12

9 months ago

0.1.11

9 months ago

0.1.10

9 months ago

0.1.9

9 months ago

0.1.8

9 months ago

0.1.7

9 months ago

0.1.6

9 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago