
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
super-device-detect
Advanced tools
super-device-detect is a precise user agent parser and device detector written in TypeScript, backed by the largest and most up-to-date open-source user agent database.
To use super-device-detect in your project, run:
npm install super-device-detect
import DeviceDetector from "super-device-detect";
import DeviceDetector = require("super-device-detect");
Example - user agent detection:
import DeviceDetector from "super-device-detect";
const deviceDetector = new DeviceDetector();
const userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36";
const device = deviceDetector.parse(userAgent);
console.log(device);
Output:
{
"client": {
"type": "browser",
"name": "Chrome",
"version": "69.0",
"engine": "Blink",
"engineVersion": ""
},
"os": {
"name": "Mac",
"version": "10.13",
"platform": ""
},
"device": {
"type": "desktop",
"brand": "Apple",
"model": ""
},
"bot": null
}
Example - bot detection:
import BotDetector from "super-device-detect/dist/parsers/bot";
const botDetector = new BotDetector();
const userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)";
const bot = botDetector.parse(userAgent);
if (bot) {
console.log(bot);
}
Output:
{
"name": "Googlebot",
"category": "Search bot",
"url": "http://www.google.com/bot.html",
"producer": {
"name": "Google Inc.",
"url": "http://www.google.com"
}
}
options
<[Object]> Options object which might have the following properties:
skipBotDetection
<[boolean]> If true, bot detection will completely be skipped (bots will be detected as regular devices). Defaults to false
.versionTruncation
<[0 | 1 | 2 | 3 | null]> Passing null
disables version truncation, so full versions will be returned. Defaults to 1
, only minor versions will be returned (e.g. X.Y).Type definitions are included in this library and exposed via:
import { DeviceDetectorResult, DeviceDetectorOptions } from "super-device-detect";
This is a free/libre library under license LGPL v3 or later.
FAQs
A device detector
The npm package super-device-detect receives a total of 4 weekly downloads. As such, super-device-detect popularity was classified as not popular.
We found that super-device-detect demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.