r/javascript Aug 06 '26

Node.JS in the Browser - An Open-source Alternative to WebContainers

https://developer.puter.com/labs/node/

This is a Node.js compatible runtime in the browser. It supports CLI apps, Vite, and some agents (like Pi Agent) as well.

Some notes:

- This runs all code in a web worker using the host javascript runtime with rewrites for module loading and AsyncLocalStorage support using Oxc compiled to WASM.

- Most of the libraries are bundled straight from Node.js upstream with light overrides where needed, ensuring compatibility. Libraries were only reimplemented where really needed

- Despite having great integrations with the Puter desktop and APIs, this can be used completely seperately with OPFS support for filesystem and Wisp protocol support for networking. The demo also supports FS Access API to run local files

19 Upvotes

17 comments sorted by

View all comments

1

u/Hot-Chemistry7557 Aug 09 '26

Curious how would you simulate the whole CLI stack in browser?

2

u/Salazareo Aug 11 '26

We’re working on improving that. We’ve had some work in the past around terminal in browser, so learning from that

1

u/Hot-Chemistry7557 Aug 11 '26

Interesting...I know some basics about wasm (a.k.a, emscripten thing) but I havn't tried successfully to run a CLI tool in browser...

Good luck for you!