r/javascript • • 6d ago

GitHub - Spxg/limo: Run JavaScript with browser Web APIs

https://github.com/Spxg/limo

Examples: https://spxg.github.io/limo

It's a CLI tool that, unlike Node.js and Deno, aims to provide a complete Web API environment, including DOM, Canvas, Web Workers, IndexedDB, OPFS, and more.

It's built on top of moli, a headless browser powered by V8 with Web API support. The name "limo" is also inspired by "moli."

I maintain several WebAssembly projects that primarily run in browsers, so I frequently need to work with JavaScript and Web APIs.

I usually write code in an environment without a GUI. Whenever I need to test something, I have to start a local HTTP server and open it in a browser on another machine with a GUI, or use ChromeDriver or another browser driver for automated testing. Sometimes I also run into compatibility issues between ChromeDriver and Chrome versions.

Over time, I found this whole process increasingly cumbersome.

What I really wanted was a simple way to execute JavaScript directly from the command line while still having access to browser Web APIs, without needing to launch and manage a separate browser. That's why I built limo.

7 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/Spxgdev 1d ago

In Limo, scripts can build and modify the DOM, apply CSS, and read computed styles. Geometry APIs such as `getBoundingClientRect()` currently return simulated positions and sizes. Canvas 2D renders real pixels offscreen, so scripts can read them back or export PNGs. Moli’s own CLI provides full-page layout and screenshots on demand.

Limo runs scripts on a secure loopback origin, so APIs like OPFS work. Permission requests follow the runtime’s headless defaults, and camera and microphone devices are reported as unavailable.

•

u/p-reyes-6823 15h ago

A real/simulated/unavailable API matrix would make it easier to judge which browser tests Limo can replace.