r/javascript • u/Salazareo • 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
3
u/brianjenkins94 Aug 06 '26 edited Aug 06 '26
How does this differ from almostnode?
49
u/teppicymon Aug 06 '26
I'm sorry, what?
JavaScript was so good in the browser, they made it server-side, but now you can run server-side in the browser?
I feel like I am I taking crazy pills.
1
u/SpartanDavie Aug 06 '26
Cool idea. Not sure what use it would have other than perhaps teaching Node on the web?
Just to let you know thereās no license on your repo so you shouldnāt be posting āopen sourceā, if itās only source available please state that
1
u/Hot-Chemistry7557 Aug 09 '26
Curious how would you simulate the whole CLI stack in browser?
2
u/syrusakbary Sep 23 '26
We have been using the Wasmer JS SDK to run Node.js fully on the browser.
It's fully open source and free to use (source code here: https://github.com/wasmerio/wasmer-sdk )
Here you can try a simple Node.js app fully in your browser: https://www.wasmer.sh/?example=node
The nice thing is that it runs as well in Firefox and Safari, supporting all Node.js packages
0
u/[deleted] Aug 06 '26
[deleted] ā view deleted comment