- Home
- NES Emulators
- JSNES
JSNES
What it is
JSNES is a free JavaScript library for emulating NES games in browsers and Node.js. Its Browser helper handles canvas display, sound, keyboard and gamepad controls, and frame timing, while the lower-level NES class lets Node.js applications provide their own rendering and audio handling. ROM data can be loaded from a URL or from strings, Uint8Array, or ArrayBuffer. The API can run frames, accept input for either of two players, reset the emulator, and adjust frame rate; it also includes methods for controlling the Zapper light gun. Applications can serialize and restore emulator state with `toJSON()` and `fromJSON()`. For battery-backed game saves, `onBatteryRamWrite` provides a way for an application to capture SRAM writes for persistence. Sound is enabled by default, with a default sample rate of 48000 Hz and an optional audio callback. The README describes npm installation for Node.js or Webpack, browser setup using an unpkg script, and React embedding; a fuller React frontend is in the repository. JSNES uses the Apache-2.0 license, and GitHub Issues is the support channel. The README recommends calling `nes.frame()` at 60 fps, with reliable timing left to the integrator.
For and against
For
- Free JavaScript library for browsers and Node.js.
- Browser helper supports keyboard and gamepad input.
- State can be serialized and restored.
- Supports two-player input and Zapper methods.
- Apache-2.0 licensed.
Against
- Reliable frame timing is the integrator's responsibility.
- Project issues include emulator accuracy and compatibility work.
- Sound and rendering may require application integration in Node.js.
The verdict
JSNES provides emulator APIs and browser helpers for application developers, along with save-state and persistent-save hooks. Its listed compatibility issues and timing responsibility are worth considering for a project.
Who it suits
JSNES suits developers building browser or Node.js applications that need NES emulation. It is also relevant to React developers seeking an embedding example or frontend reference.
Plans and prices
JSNES
Open-source JavaScript NES emulator library
Read 8 Oct 2026 · github.com
On the record
- Audio
- The API supports an audio callback and has sound emulation enabled by default with a default sample rate of 48000 Hz.github.com · read 7 Oct 2026
- Browser frontend
- The Browser helper handles canvas rendering, audio, keyboard input, gamepad input, and frame timing.github.com · read 7 Oct 2026
- Browser setup
- The browser interface handles canvas rendering, audio, keyboard and gamepad input, and frame timing.github.com · read 8 Oct 2026
- Controllers
- The browser interface supports keyboard and gamepad controls, and exposes remapping for both.github.com · read 8 Oct 2026
- Emulation controls
- The NES API includes loading ROM data, running frames, button input, reset, and frame rate methods.github.com · read 7 Oct 2026
- Frame rate
- The README says to call nes.frame() at 60 fps and makes reliable timing the integrator's responsibility.github.com · read 8 Oct 2026
- Input support
- The Browser helper supports keyboard and gamepad input, and its keyboard bindings can be customized at runtime.github.com · read 7 Oct 2026
- Installation
- The README documents installation with npm install jsnes and browser use through an unpkg script.github.com · read 8 Oct 2026
- Known limitations
- Open project issues list emulator accuracy and compatibility work, including mapper coverage, graphics, audio, and ROM loading issues.github.com · read 7 Oct 2026
- License
- The repository identifies its license as Apache-2.0.github.com · read 8 Oct 2026
- Maintainer
- The package metadata names Ben Firshman as the author.github.com · read 7 Oct 2026
- Node integration
- The lower-level NES class supports custom rendering and audio handling and can be used in Node.js.github.com · read 8 Oct 2026
- Persistent game saves
- The API calls `onBatteryRamWrite` when battery-backed SRAM is written so applications can persist save data.github.com · read 7 Oct 2026
- Purpose
- JSNES is a JavaScript NES emulator library that works in browsers and Node.js.github.com · read 8 Oct 2026
- React
- The README provides a React embedding example and says a full-featured React frontend is in the repository's web directory.github.com · read 8 Oct 2026
- ROM loading
- The library can load ROM data from a URL or from a string, Uint8Array, or ArrayBuffer.github.com · read 8 Oct 2026
- Save data
- The onBatteryRamWrite callback allows applications to persist battery-backed SRAM data.github.com · read 8 Oct 2026
- Save states
- The API can serialize emulator state with toJSON() and restore it with fromJSON().github.com · read 8 Oct 2026
The review
JSNES is a free JavaScript NES emulator library for browser and Node.js applications. It is best for developers building their own emulator-powered experiences rather than people seeking a finished game-player app. Its flexible integration surface is compelling, but projects that need broad ROM compatibility or hands-off timing should consider alternatives.
Overview
JSNES combines a browser helper with a lower-level NES class. In a browser, the helper can manage canvas output, audio, keyboard and gamepad input, and frame timing. Node.js applications can use the lower-level class and provide their own rendering and audio paths, making the package adaptable to custom frontends and services.
Installation covers npm for Node.js or Webpack and an unpkg script for direct browser use. A React embedding example is included, alongside a fuller React frontend in the repository's web/ directory. Apache-2.0 licensing permits use as an open-source component, while GitHub Issues serves for bug reports and feature requests.
Key features
ROMs, frames, and controllers
The NES API accepts ROM data from a URL, string, Uint8Array, or ArrayBuffer. Applications can run frames, reset the emulator, and use frame-rate methods, with controller input available for player one or player two. The browser interface supports keyboard and gamepad controls and allows bindings to be remapped at runtime. Zapper movement and trigger methods add light-gun input for software that needs it.
Rendering and audio
The browser helper supplies canvas rendering, audio handling, input plumbing, and frame timing in one integration layer. Lower-level Node.js use leaves rendering and audio decisions to the application, which suits projects with an existing media pipeline but requires more engineering. Audio callbacks are supported, and sound emulation is enabled by default with a default 48,000 Hz sample rate.
State and persistent saves
toJSON() and fromJSON() let an application serialize and restore emulator state, useful for quick-save features or suspended sessions. Battery-backed SRAM writes trigger onBatteryRamWrite, giving developers a point at which to persist game saves outside the emulator. These hooks are valuable building blocks, although storage, save-file policy, and user-facing management remain application responsibilities.
Timing and compatibility
The README calls for nes.frame() to run at 60 frames per second and places reliable timing on the integrator. That is manageable for teams controlling their own loop, but it is a drawback when an application needs the library to guarantee pacing. Open project issues cover accuracy and compatibility work involving mapper coverage, graphics, audio, and ROM loading, so title coverage should be validated against a project's actual ROM set.
Pricing
JSNES has one free plan, JSNES, priced as free. It is an open-source JavaScript NES emulator library with no free trial because the software is already free. There are no paid tiers or seat and usage quotas stated, so the practical cost advantage is strongest for developers who can supply their own hosting, storage, frontend work, and support process.
Platforms
JSNES supports browsers and Node.js, with Linux and web listed as platforms. npm and Webpack fit JavaScript build pipelines, while the unpkg option supports browser inclusion without a package step. The lower-level API's custom rendering and audio paths make Node.js integration more suitable for specialized applications than for users wanting a standalone desktop emulator.
Who it's for
Choose JSNES when you are building a browser or Node.js product that needs programmable NES emulation, two-player input, remappable controls, save states, persistent battery saves, or React integration. It is especially appropriate for teams comfortable owning a render loop and validating ROM behavior. It is a poor fit for someone who simply wants a turnkey emulator, or for a project whose compatibility requirements leave no room for unresolved mapper, graphics, audio, or loading issues.
Pros and cons
Pros
- Free Apache-2.0 software: there is no purchase barrier for incorporating the library into a project.
- Broad integration API: ROM loading, frame control, reset, two-player input, Zapper methods, and customizable browser controls support tailored frontends.
- Useful state hooks: JSON state serialization and battery-RAM callbacks cover both quick saves and persistent game data.
- Flexible media handling: browser conveniences can be replaced by custom Node.js rendering and audio, with callback audio and 48,000 Hz default sound.
Cons
- Timing is your responsibility: applications must call nes.frame() reliably at 60 fps rather than relying entirely on the library.
- Compatibility remains a concern: ongoing issues include mapper, graphics, audio, and ROM-loading problems.
- Not a finished player: storage, presentation, and much of the surrounding product experience must be built by the integrator.
Alternatives
For a free open-source option on Apple platforms, Nesbit runs on iOS and macOS under the MIT License.
If you want a paid emulator spanning Android, iOS, and Linux, Lynx.emu costs $2.99 once; ROMs are supplied by the user.
GoNES is a free, open-source choice for Linux, macOS, web, and Windows.
NESER is free MIT-licensed software for Linux, macOS, web, and Windows.
Nestalgia is a free option for Linux, macOS, and Windows.
For a Windows-only open-source Win32 emulator, Nintendulator is free; full speed is estimated to require a 1500 MHz-or-faster CPU.
HalfNES is free for Linux, macOS, and Windows, requires Java 8 or newer, and has no savestates.
Jnes is free Windows freeware to download and use, but cannot be sold or distributed through commercial channels.
Verdict
JSNES is a strong fit for JavaScript developers who want a no-cost NES emulation core with browser helpers, custom Node.js integration, controller flexibility, and explicit save-state hooks. Choose it when you are prepared to own frame timing and test the ROMs you support. Look elsewhere when unresolved compatibility issues or the need for a ready-to-play, self-timing emulator outweigh the benefits of an adaptable API.