How wasmerio/edgejs works
Edge.js is a Node.js-compatible JavaScript runtime aimed at secure edge and AI workloads. The main workflow is to launch a program or wrap a package-manager command, execute JavaScript through a selectable engine, and expose Node-compatible APIs; safe mode adds WebAssembly sandboxing. The README also documents an experimental host-engine WASIX mode using N-API imports. The supplied tree and excerpts show only a few runtime internals and vendored components, so several documented subsystems have no confidently identifiable implementation path here.
Main entry points: webstorage.js Web Storage · v8 V8 engine · wasm-engine.cc Wasm sandbox · pipeline.js Stream pipeline
Components 16
Runtime execution
- Edge CLI
- Runtime core
- N-API layer
Engine and security
- V8 engine
deps/v8 - QuickJS engine
- JavaScriptCore
- Wasm sandbox
deps/v8/src/wasm/wasm-engine.cc
Runtime APIs
- Node compatibility
- Stream pipeline
lib/internal/streams/pipeline.js - Web Storage
lib/internal/webstorage.js - Networking
deps/cares/src/lib - Crypto engines
deps/ncrypto/engine.cc
External integrations
- Package commands
- Host JavaScript engine
- Storage file
Other components
- User
Connections 16
- User → Edge CLI: launches
- Edge CLI → Runtime core: starts
- Edge CLI → Package commands: wraps commands
- Package commands → User: returns result
- Runtime core → N-API layer: exposes APIs
- N-API layer → V8 engine: executes on
- N-API layer → QuickJS engine: executes on
- N-API layer → JavaScriptCore: executes on
- Runtime core → Wasm sandbox: sandboxes in safe mode
- Runtime core → Host JavaScript engine: imports host N-API
- Runtime core → Node compatibility: provides compatibility
- Node compatibility → Stream pipeline: includes pipeline
- Node compatibility → Web Storage: includes storage API
- Node compatibility → Networking: includes DNS support
- Node compatibility → Crypto engines: includes crypto support
- Web Storage → Storage file: uses configured file