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

hardetect

v1.1.1

Published

Detect device capabilities in-browser.

Readme

Hardetect

Zero-dependency TypeScript package that collects reliable, structured hardware information about the visiting device and returns it as one clean, stable, exhaustive JSON object.

Highlights

  • 🪶 Zero runtime dependencies.
  • 🤝 Stable JSON shape : getHardwareProfile() always returns the same keys, on every browser and in Node/SSR. Unavailable values are null, never undefined.
  • 🛡️ Defensive : every browser API call is wrapped in a timeout-bounded safeRun. The function never throws.
  • 🪫 Battery-friendly : total collection time target: < 100 ms on a modern device; micro-benchmark capped at ~25 ms.
  • 📦 Dual ESM + CJS with full .d.ts declarations.
  • ⚖️ MPL-2.0 licensed.

Installation

bun install hardetect

OR

npm install hardetect

Requires TypeScript 5+ to consume the type declarations. JavaScript/Node consumers do not need TypeScript at runtime.

Quickstart

import { getHardwareProfile } from 'hardetect';

const profile = await getHardwareProfile();
console.log(profile);

Example output

{
  "meta": {
    "schemaVersion": "1.0.0",
    "collectedAt": "2026-06-21T10:32:00.000Z",
    "durationMs": 184,
    "partialErrors": []
  },
  "gpu": {
    "backend": "webgpu",
    "vendor": "google",
    "architecture": "metal-3",
    "description": "ANGLE (Apple, ANGLE Metal Renderer: Apple M2, Unspecified Version)",
    "maxStorageBufferBindingSize": 1073741824,
    "maxComputeWorkgroupStorageSize": 32768
  },
  "cpu": {
    "logicalCores": 10,
    "simdSupported": true,
    "threadsSupported": true,
    "benchmarkScore": 412.7
  },
  "system": {
    "deviceMemoryGB": 8,
    "isSafari": false,
    "isIOS": false,
    "browserEngine": "gecko",
    "architecture": "arm",
    "bitness": "64",
    "model": null
  },
  "display": {
    "screenWidth": 1512,
    "screenHeight": 982,
    "devicePixelRatio": 2,
    "colorDepth": 30,
    "language": "fr-FR",
    "languages": ["fr-FR", "fr", "en-US", "en"],
    "timeZone": "Europe/Paris",
    "maxTouchPoints": 0
  },
  "storage": {
    "quotaBytes": 1073741824000,
    "usageBytes": 245000000,
    "availableBytes": 1073496800000,
    "isPersisted": false,
    "hasIndexedDB": true,
    "hasCacheAPI": true
  },
  "context": {
    "battery": { "charging": true, "level": 0.87 },
    "network": { "saveData": false, "effectiveType": "4g" }
  }
}

The shape never changes across browsers only the values do.

Development

bun install
bun run typecheck    # tsc --noEmit
bun run build        # tsup
bun test             # vitest run, happy-dom env
bun run format       # prettier --write

Run bun run example for a fully working in-browser demo.

License

MPL-2.0. THIS PROJECT WAS NOT INTENDED FOR MALICIOUS PURPOSES, ONLY FOR CHOOSING THE TECHNOLOGIES ADAPTED TO THE TARGET ENVIRONMENT.