npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ua-parser-node

v0.2.2

Published

Node bindings for ua-parser (uap-rust): browser, OS and device with full versions, plus major-only convenience fields

Readme

ua-parser-node

Node bindings for ua-parser (uap-rust), the official Rust implementation of the uap-core user-agent regex spec.

import { parseUserAgent } from 'ua-parser-node'

parseUserAgent(
  'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36',
)
// => {
//   browser: 'Chrome',
//   browserVersion: '138',          // major, for analytics grouping
//   browserVersionFull: '138.0.0.0',
//   os: 'Mac OS X',
//   osVersion: '10',                // major
//   osVersionFull: '10.15.7',
//   device: 'Mac',
//   brand: 'Apple',
//   model: 'Mac',
// }

Fully typed: index.d.ts ships with the package, generated from the Rust API.

An ESM package ("type": "module"): static import works everywhere, and require() works on Node versions that support require(esm).

Why

The maintained JavaScript user-agent parsers are a mixed bag: ua-parser-js v1 is frozen, v2 is AGPL-licensed, node-device-detector is 2.4MB, and detect-browser is unmaintained. The actively maintained part of this problem is the uap-core regex database, a data spec any Rust implementation can consume. This package binds uap-rust to it: uap-rust is actively maintained, so the parsing rules stay current without this package maintaining its own.

API

parseUserAgent(ua: string): UaResult

All uap-core domains are extracted in one call — browser family + version, OS + version, and device family/brand/model. Version fields come in two forms: *Version (major only, for analytics grouping) and *VersionFull (the complete dotted string). Unmatched input returns a result with every field undefined and never throws.

Supported platforms

| package | triple | | --- | --- | | ua-parser-node-darwin-arm64 | aarch64-apple-darwin | | ua-parser-node-linux-x64-gnu | x86_64-unknown-linux-gnu | | ua-parser-node-linux-arm64-gnu | aarch64-unknown-linux-gnu | | ua-parser-node-linux-arm64-musl | aarch64-unknown-linux-musl | | ua-parser-node-win32-x64-msvc | x86_64-pc-windows-msvc |

License

Dual-licensed MIT OR Apache-2.0, matching uap-rust.