JSBedded: prototype microcontroller hardware at the speed of JavaScript
The slow part of embedded work isn’t writing the code, it’s the loop: edit, compile, link, flash, reboot, repeat. Add an SDK, CMake and a cross-compiler to install first, and a ten-line experiment takes an afternoon.
JSBedded removes that loop. You flash your dev board once, then you just edit JavaScript or TypeScript in any editor and run it. It’s built for AI-first prototyping, so a coding agent can write, run and debug the code end to end.
Early development: the firmware is published as pre-releases.
- Website and docs: stan-kondrat.github.io/jsbedded
- Source: github.com/stan-kondrat/jsbedded (MIT)
What it looks like
// main.ts: edit, save, run. No firmware rebuild.
const led = board.LED;
let on = false;
gpio.mode(led, "output");
setInterval(() => {
on = !on;
gpio.write(led, on ? 1 : 0);
console.log(on ? "LED on" : "LED off");
}, 500);
Save main.js to the JSBEDDED USB drive, reset the board, and it runs.
From zero to running in four steps
- Flash once. Drop the ready-made firmware (UF2 for the Pico family) onto your board. It’s the only thing you ever flash.
- Write
main.ts. Any editor, with typed APIs from the@jsbeddednpm scope. - Save to the USB drive. The board shows up as a drive named
JSBEDDED. Savemain.jsthere and reset. No rebuild, no reflash. - Read logs. Logs come over serial. A faulty script? The reset button recovers the board.
Why it’s fast, and AI-friendly
- No toolchain. No SDKs, CMake or cross-compilers. If you can run a script, you can program the board.
- No compile phase. Your change is on the device in seconds, not after a full rebuild and reflash.
- Saves AI tokens. A small script and a typed API instead of build files, HAL code and SDK noise: less context, fewer wrong turns.
- Agent-drivable. Typed APIs, deploy by saving a file, serial logs and recovery let an agent do the whole loop.
- Any editor. VS Code, Vim, or your agent. No IDE, vendor tool or account.
- Safe to experiment. A bad script won’t brick the board; reset and you’re back to a working device.
Under the hood
- TypeScript. Typed hardware APIs with autocomplete. One API definition generates both the C bindings and the reference docs.
- Multi-engine. Pick the JS engine per firmware image to trade size against speed; the API stays the same.
- Local-first and private. No account, no cloud dependency, telemetry off by default.
Boards and engines
Boards: Raspberry Pi Pico, Pico W, Pico 2, Pico 2 W, ESP32-C3, ESP32-S3.
Engines: mquickjs, QuickJS, Duktape, JerryScript, Ant.
Support is growing, and these are the targets today. Adding a board, engine or platform is a documented path - see the porting guide and the live support matrix for what is measured. Contributions are welcome.
Get started
Start with the getting started guide, browse the docs, or open an issue on GitHub.