jsnes is a JavaScript-based NES emulator that runs classic NES games in the browser or in Node.js. It provides cycle-accurate CPU emulation, frame-buffer-based video rendering, and sample-buffer audio synthesis, along with a ROM cartridge mapper abstraction for broad game compatibility.
The emulator exposes a programmable core with a simple API for controlling emulation state, capturing screenshots, and managing save data. It supports keyboard control remapping at runtime, with settings persisted to localStorage, and offers state serialization for save and restore operations. Battery-backed SRAM changes are handled through a callback-driven persistence mechanism.
The project covers browser-based NES emulation with automatic canvas rendering and input handling, as well as headless emulation in Node.js for custom rendering pipelines. It also provides programmatic control over emulator state, including pause, resume, reset, and ROM reloading.