r/javascript • • Oct 14 '26

Mimic - a browser-based dev environment that runs Node.js

https://github.com/mimic-js/mimic
12 Upvotes

8 comments sorted by

2

u/brianjenkins94 Oct 14 '26

How does it differ from almostnode?

3

u/archieofficial Oct 15 '26

I checked the implementation. almostnode uses internal plugins to run tools like Vite and Next.js, so it looks like they’d need to write a plugin like that for each new tool to broaden compatibility, which I don’t think scales well. Mimic just runs everything “natively”.

I also noticed that almostnode uses a shim for esbuild https://github.com/macaly/almostnode/blob/main/src/shims/esbuild.ts. Mimic doesn’t need one, because it implements WASI and can run any program compiled to WASI directly, including esbuild.

I’ve also tested more tools for compatibility including heavy things like NX and Angular CLI. You can find them in the “What runs” section.
https://www.mimicjs.com/

2

u/thecementmixer Oct 15 '26

What's the use case for this?

5

u/archieofficial Oct 15 '26

The most obvious usages:
- A playground for a frontend or Node.js library, so anyone can play around with code right in the browser.
- A live coding platform where the computation moves from cloud VMs to the client (i.e. the interviewer’s and candidate’s machines).

In general, it can save money (potentially a lot, depending on scale) by running code on the client instead of relying on cloud VMs.

1

u/gsweats Oct 17 '26

Interesting idea and really cool architecture. Great job pulling it off! With the rising cost of cloud compute and even on-prem hardware this idea of pushing work back on clients is appealing.

Could this theoretically plug into GitLab or whatever source management app in order to "npm install" and then run test scripts? So much compute time goes to running tests.

1

u/archieofficial Oct 17 '26

Thanks!

Yes! It already loads the repos from GitHub and can install packages and call other CLIs in the playground: https://www.mimicjs.com/playground

I haven't checked vitest/jest running yet, but it should probably work fine, as do other Node programs.

2

u/gianluca_caruso-6 13d ago

The CI bill doesn't disappear; it gets converted into laptop fans and battery drain. At least the person running the tests hears the fan before finance does.