npm.io
0.1.1 • Published 22h agoCLI

wasm-exec-worker

Licence
MIT
Version
0.1.1
Deps
2
Size
55 kB
Vulns
0
Weekly
0

wasm-exec-worker

Worker agent for wasm-exec, a single-node distributed WebAssembly execution service. The agent connects outbound to a wasm-exec server over WebSocket (works fine behind NAT), receives WASI modules, and executes each one in a sandboxed child process — no filesystem, no network, memory-capped, wall-clock-limited.

Usage

npx wasm-exec-worker --key wk_... --server wss://your-app.fly.dev
flag default
--key WASM_EXEC_KEY env var worker key minted by the server operator
--server WASM_EXEC_SERVER env var server URL
--max-concurrent cpu cores max parallel jobs
--cache-dir ~/.cache/wasm-exec module cache (sha256-keyed, LRU 1 GiB)

The agent reconnects forever with exponential backoff, caches modules by sha256 so repeat runs skip the transfer, and SIGKILLs any module that traps, spins past its timeout, or exceeds 10 MiB of output per stream.

Requires Node ≥ 22 (uses the built-in node:wasi and WebSocket).