Expand description
node:wasi module — WASI preview1 implementation via JS IIFE.
Provides the WASI class and wasiSnapshotPreview1 object that enable
running WebAssembly modules compiled to the WASI ABI. The implementation
uses pure JS to bridge WASI syscalls to the host environment.
§Architecture
Follows the same JS IIFE pattern as node_stream.rs / node_vm.rs:
WASI_SOURCEconst holds the JS sourceinstall()evaluates the IIFE, extracts the returned object, and registers it viacache_builtin(cx, "wasi", ...)
§References
- Bun upstream:
src/js/node/wasi.ts - WASI preview1 spec: https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md