binterly-user-agent-parser v0.2.3
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"
}
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago