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

hwinfo-reader

v1.0.1

Published

Read HWiNFO64 sensor data from Windows shared memory — fully typed TypeScript library

Downloads

212

Readme

hwinfo-reader

Read HWiNFO64 sensor data from Windows shared memory — fully typed TypeScript library.

Returns structured sensor data (CPU temps, GPU clocks, fan speeds, voltages, etc.) directly as JavaScript objects. No printing, no side effects.

Requirements

  • Windows only
  • HWiNFO64 running with Shared Memory Support enabled
    (Settings → HWiNFO Gadget → Activate Shared Memory)
  • Node.js ≥ 18

Installation

npm install hwinfo-reader

No native build tools needed — uses koffi with prebuilt binaries.

Usage

One-shot read

import { readHWiNFO } from 'hwinfo-reader';

const snapshot = readHWiNFO();

console.log(snapshot.sensors.length);   // e.g. 18
console.log(snapshot.readings.length);  // e.g. 260

// Sensors have readings nested inside
for (const sensor of snapshot.sensors) {
  console.log(sensor.nameOriginal);       // "CPU [#0]: Intel Core i7-13620H"
  for (const r of sensor.readings) {
    console.log(r.labelOriginal, r.value, r.unit); // "CPU Package" 55 "°C"
  }
}

// Or use the flat readings list directly
const cpuTemp = snapshot.readings.find(
  r => r.labelOriginal === 'CPU Package' && r.readingType === 'Temperature'
);
console.log(cpuTemp?.value); // 55

Persistent reader (efficient polling)

import { createHWiNFOReader } from 'hwinfo-reader';

const reader = createHWiNFOReader();

const timer = setInterval(() => {
  const data = reader.read();
  // use data...
}, 1000);

process.on('SIGINT', () => {
  clearInterval(timer);
  reader.close();
  process.exit(0);
});

API

readHWiNFO(options?): HWiNFOSnapshot

Opens shared memory, reads once, closes. Best for infrequent polling.

createHWiNFOReader(options?): { read(): HWiNFOSnapshot, close(): void }

Keeps the mapping open across calls. Best for frequent polling (avoids repeated OpenFileMapping overhead).

HWiNFOSnapshot

interface HWiNFOSnapshot {
  version:    number;
  version2:   number;
  lastUpdate: bigint;       // HWiNFO poll timestamp
  sensors:    Sensor[];     // each sensor has .readings[] nested inside
  readings:   SensorReading[]; // flat list of all readings across all sensors
}

Sensor

interface Sensor {
  index:        number;
  sensorId:     number;
  sensorInst:   number;
  nameOriginal: string;  // "GPU [#1]: NVIDIA GeForce RTX 5060 Laptop"
  nameUser:     string;
  readings:     SensorReading[];
}

SensorReading

interface SensorReading {
  index:         number;
  readingType:   SensorReadingType; // 'Temperature' | 'Clock' | 'Usage' | ...
  sensorIndex:   number;
  readingId:     number;
  labelOriginal: string;   // "GPU Core"
  labelUser:     string;
  unit:          string;   // "°C", "MHz", "%", "W", ...
  value:         number;
  valueMin:      number;
  valueMax:      number;
  valueAvg:      number;
}

type SensorReadingType =
  | 'None' | 'Temperature' | 'Voltage' | 'Fan'
  | 'Current' | 'Power' | 'Clock' | 'Usage' | 'Other' | 'Unknown';

License

MIT