JSNES is a JavaScript NES emulator that runs in both the browser and Node.js.
The tool emulates the Nintendo Entertainment System by implementing the 6502 processor and NES hardware components. It accepts ROM files as input and executes them frame-by-frame, producing pixel buffers and audio samples that can be rendered and played back. The emulator supports save states through serialization and deserialization of its internal state, and handles input from keyboards, gamepads, and the Zapper light gun peripheral.
For browser integration, the project provides a high-level `Browser` class that automatically manages canvas rendering, audio playback, keyboard and gamepad input, and frame timing, requiring only a container element and ROM data to get running. A complete React frontend is also included in the repository. For developers needing lower-level control—such as custom rendering pipelines, audio handling, or Node.js integration—the core `NES` class exposes callbacks for frame buffers, audio samples, and status updates, along with methods to control emulation timing, button input, and state persistence. The tool supports battery-backed SRAM for game save data through a callback mechanism.
The project maintains active development with regular commits addressing bug fixes and feature improvements. Pull requests receive timely review and feedback from maintainers. The codebase shows consistent attention to both core emulation accuracy and user-facing API design, with documentation kept current alongside code changes.