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

device-web-identifier

v0.1.0

Published

Browser device fingerprinting and identification utility

Readme

device-web-identifier

A lightweight browser utility for device fingerprinting and identification. Collects browser, OS, hardware, and network metadata using FingerprintJS and ua-parser-js.


Features

  • Unique visitor fingerprint via FingerprintJS
  • OS name and version detection
  • Browser name and version detection
  • Device type, vendor detection
  • CPU architecture detection
  • Screen resolution, language, and timezone
  • Logical processor count
  • Dual ESM/CJS output — works with Vite, Webpack, Rollup, and plain <script type="module">

Installation

npm install device-web-identifier

Usage

ES Module (Vite, modern bundlers)

import { getDeviceIdentification } from "device-web-identifier";

const info = await getDeviceIdentification();
console.log(info);

Plain HTML (no bundler)

<script type="module">
  import { getDeviceIdentification } from "./node_modules/device-web-identifier/dist/index.mjs";

  const info = await getDeviceIdentification();
  console.log(info);
</script>

CommonJS (Node-compatible bundlers)

const { getDeviceIdentification } = require("device-web-identifier");

Note: This is a browser-only package. It relies on window, navigator, and screen APIs. Do not use it in a Node.js server environment.


Return Value

getDeviceIdentification() returns a Promise<DeviceIdentification>:

interface DeviceIdentification {
  finger_print: string;       // Unique visitor ID (FingerprintJS)
  confidence: number;         // Fingerprint confidence score (0–1)
  device_os: string;          // e.g. "Windows", "macOS", "Android"
  os_version: string;         // e.g. "10", "14.0"
  device_type: string;        // "mobile" | "tablet" | "desktop"
  device_vendor: string;      // e.g. "Apple", "Samsung", "Generic"
  browser_name: string;       // e.g. "Chrome", "Firefox", "Safari"
  browser_version: string;    // e.g. "124.0.0"
  cpu_architecture: string;   // e.g. "amd64", "arm"
  screen_resolution: string;  // e.g. "1920x1080"
  language: string;           // e.g. "en-US"
  time_zone: string;          // e.g. "Africa/Tunis"
  logical_processors: number | string; // e.g. 8
}

Example output

{
  "finger_print": "a1b2c3d4e5f6...",
  "confidence": 0.995,
  "device_os": "Windows",
  "os_version": "10",
  "device_type": "desktop",
  "device_vendor": "Generic",
  "browser_name": "Chrome",
  "browser_version": "124.0.6367.60",
  "cpu_architecture": "amd64",
  "screen_resolution": "1920x1080",
  "language": "en-US",
  "time_zone": "Africa/Tunis",
  "logical_processors": 8
}

API

getDeviceIdentification(): Promise<DeviceIdentification>

Asynchronously collects and returns device metadata. Must be called in a browser context.


Build

npm install
npm run build

Output in dist/:

| File | Format | Purpose | |---|---|---| | index.mjs | ESM | Modern bundlers, <script type="module"> | | index.js | CJS | CommonJS / older bundlers | | index.d.ts | Types | TypeScript consumers |


Requirements

  • Browser environment (Chrome, Firefox, Safari, Edge)
  • No server-side rendering support

Dependencies

| Package | Version | Purpose | |---|---|---| | @fingerprintjs/fingerprintjs | ^5.2.0 | Visitor fingerprinting | | ua-parser-js | ^2.0.10 | User-agent parsing |


License

MIT © Mouhib Sellami