Headless and fast
No window and no display server. Step frames far faster than real time, in-process or in a worker thread that never blocks your event loop.
Benchmarks
Step frames, press buttons, read memory and capture the screen in Game Boy, Game Boy Color and GBA games, all from TypeScript. Powered by mGBA's libmgba core, built for AI agents, automation and research.

pnpm add node-mgbanpm install node-mgbayarn add node-mgbaRequires Node.js 20 or newer on x64 Linux or Windows. Bring your own ROMs.
import { Mgba } from 'node-mgba';
// Load a ROM (.gb, .gbc or .gba)
const emu = await Mgba.load('./game.gb');
// Advance a second of game time, then press A
await emu.controls.tick(60);
await emu.controls.press('A');
// Read memory and grab the screen
const playerX = await emu.memory.read8(0xd362);
const png = await emu.screen.toPng();
await emu.close();node-mgba started as the emulator layer for Gemini Plays Pokémon, the 24/7 Twitch stream where Gemini plays Pokémon on its own. It's the same code the stream runs on, packaged so you can build your own game-playing agents. Read The Making of Gemini Plays Pokémon, or watch the agent think in the web viewer.