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

node-rcheevos

v1.0.0

Published

Node.js native bindings for RetroAchievements rcheevos library (hash generation)

Downloads

304

Readme

node-rcheevos

npm version

Generate RetroAchievements hashes for ROMs in Node.js. Uses the same rcheevos C library that RetroArch uses, so your hashes will match exactly.

Why not just reimplement the hashing in JavaScript?

I tried that first. Each console has its own special hashing rules - NES strips the iNES header, SNES might have a 512-byte header to skip, PlayStation has to parse SYSTEM.CNF to find which executable to hash, N64 needs byte-order conversion depending on the ROM format. The RetroAchievements docs explain all this, but keeping JavaScript implementations updated for 40+ systems when RA changes their logic is a pain. Easier to just wrap their C library directly.

Built this for ROMie but figured it's useful standalone.

Installation

npm install node-rcheevos

Includes pre-built binaries for macOS, Windows, and Linux (both x64 and ARM64). If you're on something else, it'll build from source automatically.

Quick Start

const { rhash, ConsoleId } = require('node-rcheevos');

const md5 = rhash(ConsoleId.GAMEBOY, '/path/to/pokemon-red.gb');
console.log(md5); // "bb7df04e1b0a2570657527a7e108ae23"

API

rhash(consoleId, path, buffer?)

Parameters:

  • consoleId (number): RetroAchievements console ID (use ConsoleId constants or numeric values)
  • path (string): Path to your ROM file
  • buffer (Buffer, optional): ROM data if you already have it in memory

Returns: MD5 hash as a lowercase hex string

Throws: Error if the file doesn't exist, can't be read, or the console ID is invalid

ConsoleId

Exported constants for all console IDs if you prefer named constants over numbers.

const { ConsoleId } = require('node-rcheevos');

console.log(ConsoleId.GAMEBOY);      // 4
console.log(ConsoleId.PLAYSTATION);  // 12
console.log(ConsoleId.PSP);          // 41

Buffer limitations

Works with buffers (cartridge-based systems like GB, GBA, NES, SNES):

const buffer = fs.readFileSync('/path/to/game.gb');
const md5 = rhash(ConsoleId.GAMEBOY, '/path/to/game.gb', buffer);

Doesn't work with buffers (disc-based like PlayStation, PSP, and arcade systems):

// Passing a buffer will throw an error - must use file path
const md5 = rhash(ConsoleId.PLAYSTATION, '/path/to/game.bin');

Disc-based systems need to read specific sectors from the image file, and arcade systems hash the filename, so they can't work with in-memory buffers.

CLI Usage

npx rhash -c 4 /path/to/game.gb

Building from Source

git clone --recursive https://github.com/jzimz/node-rcheevos.git
cd node-rcheevos
npm install
npm run build

The --recursive flag is important - it pulls in the rcheevos library. Without it, you won't have anything to build against.

License

MIT. The rcheevos library is also MIT.