Edge.js: Run Node apps inside a WebAssembly sandbox

wasmer.io

69 points by syrusakbary 5 hours ago


syrusakbary - 3 hours ago

Hi HN!

I'm Syrus, from Wasmer. We built Edge.js in a few weeks after different trials trying to bring Node.js to the Edge. We used AI and Codex heavily for this project, as otherwise the timeline would have spanned to a year plus to develop.

The summary of this announcement is that Edge.js:

  * Runs using WebAssembly when in `--safe` mode
  * It's fully compatible with Node.js (passing all their spec tests for non-VM modules)
  * It has a pluggable JS engine architecture: can work with V8, Javascript, SpiderMonkey, QuickJS, Hermes, etc.
Super happy to answer any questions you may have!
willquack - 2 hours ago

Awesome project!

Dumb question: could you run this in frontend js using the browser's js engine and wasm environment similar to WebContainers? Maybe `fs` is just in-memory, and some things like forking are disabled. It'd be cool to have "nodejs" in the web!

pscanf - 2 hours ago

Very cool project!

Question regarding the pluggable js engine: I have an electron app where I'm currently using QuickJS to run LLM-generated code. Would edge.js be able (theoretically) to use electron's v8 to get a "sanboxed within electron" execution environment?

MillionOClock - 2 hours ago

Very interesting! On what platforms can this run? If it can run on iOS, how would you handle attempts to access to the file system or networking, is this already wired in somehow? If not is it easy to add custom handlers to handle these actions?

alex_reg - 3 hours ago

It's a bit confusing.

Roughly:

* a refactor of Node.js, but using a standardized API for JS engine interop * Integration with the Wasmer CLI so it will run JS with v8 but, everything else in Webassembly

Interesting idea.

Could be a much lighter weight way to sandbox JS...

- 2 hours ago
[deleted]
leontloveless - 3 hours ago

[dead]