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

hddserial

v2.0.3

Published

Cross-platform disk serial retrieval for Node.js.

Readme

hddserial

npm node

Retrieve physical disk serial numbers on Linux, Windows, and macOS.

This package is intentionally focused on storage serial retrieval only. It does not expose CPU IDs, MAC addresses, motherboard identifiers, or machine UUIDs.

Requirements

  • Node.js >= 18

Install

npm install hddserial

Usage (Promise)

const hddserial = require('hddserial');

(async () => {
  const serial = await hddserial.first();
  console.log(serial);
})();

Usage (Callback)

const hddserial = require('hddserial');

hddserial.first((err, serial) => {
  if (err) return console.error(err);
  
  console.log(serial);
});

Methods

  • first() -> returns first disk serial
  • all() -> returns all detected serials
  • one(index) -> returns serial at index
  • check(serial) -> checks if serial exists

Behavior Notes

  • Serial values are normalized to reduce OS-specific formatting noise.
  • Results are deduplicated and returned in stable order.
  • one(index) uses zero-based indexing.
  • check(serial) compares normalized serial values.

Limitations

  • Disk serial availability depends on OS and permissions
  • Some environments (Docker, VM, cloud) may not expose real disk serials
  • macOS and certain SSDs may return limited or no serial information

Supported Platforms

  • Linux
  • Windows
  • macOS

Cross-Platform Validation

hddserial is validated in CI and real environments to ensure reliability across operating systems.

CI (GitHub Actions)

  • Operating systems: Linux (ubuntu-latest), Windows (windows-latest), macOS (macos-latest)
  • Node.js versions: 18, 20, 22
  • Checks: npm ci, package entry validation, npm test, runtime smoke test (no crash), npm pack --dry-run

All CI matrix jobs are passing successfully.

Real Environment Testing

  • Windows 11 (physical machine): successfully retrieves disk serials and API behavior is verified
  • Ubuntu 24.04 (Proxmox VM): installs and runs correctly, API executes without errors

Limitations and Notes

  • Disk serial availability depends on operating system permissions, hardware type, storage drivers, and virtualization environment
  • Virtualized environments (for example Proxmox, KVM, Docker) may not expose real disk serials
  • The library returns available disk/storage serials reported by the operating system

Testing Summary

| Environment | Result | Notes | | --- | --- | --- | | Windows 11 (Physical) | ✅ | Real disk serial detected | | Ubuntu 24.04 (VM) | ✅ | Tested successfully | | Linux (CI) | ✅ | Passed | | Windows (CI) | ✅ | Passed | | macOS (CI) | ✅ | Passed |

CI Status

CI

License

MIT