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

sm64-binds-frontend

v2.0.1

Published

Mario 64 using WASM. Requires a US .z64 version ROM to work (8.00MB)

Readme

sm64-binds-frontend

Mario 64 binds with graphics for the browser. sm64-binds

To avoid shipping copyrighted ROM data, the WASM module is distributed XOR'd against a US .z64 ROM and recombined in the browser at runtime. The ROM is required: a US z64 copy, exactly 8.00 MB.

Install

npm install sm64-binds-frontend

Usage

Drop in the <FileUpload> component, let the user pick their ROM, then drive the game:

import { useRef } from "react";
import { FileUpload, sm64_record, GameConfig, GamepadButtons } from "sm64-binds-frontend";

function Game({ hasRom }) {
    const canvas = useRef(null);

    if (!hasRom) {
        return <FileUpload setHasRom={...} />;
    }

    return <canvas ref={canvas} className="emscripten" />;
}

The WASM module draws to a <canvas>; it needs the emscripten class for correct sizing.

Recording and replaying

sm64_record plays the game and records every frame's controller input, so a run can be replayed or solved later:

import { sm64_record, sm64_evaluate, GameConfig, RngConfig } from "sm64-binds-frontend";

const game_config = GameConfig.defaultConfig();
const solution = await sm64_record(canvas, 22, game_config);
const success = await sm64_evaluate(canvas, solution, 22);

Randomised input

Pass an RngConfig to perturb the controller, so a replay has to match the seed exactly:

import { RngConfig } from "sm64-binds-frontend";

const rng = new RngConfig(100, 5, 2, 0.5, 0.5, 0.2);
const game_config = new GameConfig(NaN, rng);

Note that the WASM RNG is active from boot with the defaults above, even before you construct a config.

Controller input

rng_pad returns what the game actually received after RNG. GamepadButtons has the N64 masks (A_BUTTON, START_BUTTON, U_JPAD, and so on).

const pad = engine.rng_pad(controllerPad);
if (pad.is_pressed(GamepadButtons.U_JPAD)) {
    // ...
}

API

| Export | Purpose | | --- | --- | | FileUpload | React component that validates and stores a ROM in IndexedDB. | | sm64_record | Plays and records inputs. | | sm64_evaluate | Replays a recorded solution. | | sm64_playback | Replays with manual control. | | GameConfig, RngConfig | Playback and RNG tuning. | | GamePad, GameState, GamepadButtons | Controller input and game state. |

Example

See js_example/ in the repository for a complete Vite + React app.

Licence

ISC. The game itself is © Nintendo; this package contains no ROM or game data.