Skip to content
Ask
Reference

Supported surface and deliberate limits

Module-by-module Node 22.18 compatibility table, supported APIs, and explicit browser-substrate boundaries.

What @inbrowser/node supports, how its browser adaptations work, and where it stops. Configurable bounds and defaults are listed in resource-policy.md, internal design in architecture.md, and trust boundaries in threat-model.md.

Supported runtime surface

  • Kernel & POSIX VFS: Dedicated kernel Worker owning an in-memory POSIX volume (memfs) over SharedArrayBuffer and Atomics, synchronous cross-process file visibility, per-process file descriptors, owner-bit permission checks (chmod, access, EACCES), fs / fs/promises (readFile, writeFile, readdir, opendir, cp, glob, watch, watchFile, mkdtemp, truncate, link, symlink, readv/writev, openAsBlob, createReadStream, createWriteStream), snapshots, IndexedDB snapshot/package-cache persistence, and workspace checkpoints.
  • Modules (CJS & ESM): Node 22.18 exports / imports package resolution, CommonJS caching and circular dependencies, process-scoped ES module graphs served by the Service Worker with live bindings, top-level await, CJS-to-ESM dynamic import(), and named CJS export detection via cjs-module-lexer.
  • Processes, shell & threads: Independently terminable guest Workers (spawn, fork with JSON and advanced structured-clone IPC, execFile/exec), scoped POSIX-style sh -c (quotes, escapes, env assignments, &&/||, pipelines, redirections, executable bit checks), and file-backed worker_threads (Worker, MessageChannel, BroadcastChannel, SharedArrayBuffer transfer, workerData, environmentData).
  • HTTP, preview & WebSockets: node:http / node:https servers with bidirectional streaming bodies, backpressure windows (preview.requestWindowBytes / preview.responseWindowBytes), SSE, WebSocket upgrade relay, prefix-mode and per-origin preview routing (BootOptions.preview.origin) with in-memory RFC 6265 cookie jar, and PreviewOptions.clientScript + onPreviewClient MessagePort channels.
  • Outbound HTTP: Socket-agent mode plus httpAgentMode: 'fetch' supporting GET, HEAD, POST, PUT, PATCH, DELETE, and OPTIONS, outbound request bodies (up to resources.http.clientBodyBytes, default 8 MiB), AbortSignal, Agent pooling, httpOmitHeaders, and httpAllowedHosts / httpBlockedHosts / httpEgress host-port policies (EACCES).
  • Streams & Web Streams: node:stream (Readable, Writable, Duplex, Transform, PassThrough, duplexPair, pipeline, finished), full Web Streams adapters (Readable.toWeb/fromWeb, Writable.toWeb/fromWeb, Duplex.toWeb/fromWeb, ReadableStream.from, Writable.prototype[Symbol.asyncDispose]), stream/web, stream/promises, and stream/consumers.
  • Compression (node:zlib): Gzip, Gunzip, Deflate, Inflate, DeflateRaw, InflateRaw, Unzip, and crc32 over pako, plus lazy Worker WebAssembly BrotliCompress / BrotliDecompress (wasm-brotli) and ZstdCompress / ZstdDecompress (@oneidentity/zstd-js) with stream, callback, and *Sync APIs (zero cold-boot WASM compilation until first codec call).
  • SQLite (node:sqlite): Lazy Worker WebAssembly DatabaseSync and StatementSync (node-sqlite3-wasm) supporting :memory: and VFS-backed database files, prepared statements, transactions, custom function() / aggregate() UDFs, sessions/changesets, and backup().
  • Crypto, V8 & node:test: node:crypto (WebCrypto subtle, SHA/MD5/RIPEMD digests, HMAC, AES/ChaCha ciphers, async RSA/EC/Ed25519 sign/verify/generateKeyPair, scrypt, pbkdf2, hkdf, and constant-time WASM timingSafeEqual), node:v8 (Serializer, Deserializer, DefaultSerializer, DefaultDeserializer, serialize, deserialize, and advisory getHeapStatistics), and node:test (describe, it, test, lifecycle hooks, subtests, mock functions/timers, and tap/spec/dot/junit reporters).
  • Experimental async context & 3-origin sandboxing: Opt-in asyncContext: 'experimental' (AsyncLocalStorage and AsyncResource across async/await, timers, and HTTP servers) and 3-origin SandboxContainer + installSandboxHost isolation.

Deliberate limits and divergences

  • Trusted guest execution within a Worker realm: Guest code shares its dedicated Worker global scope with guest-side shims and is not hardened against hostile code execution. In default same-origin prefix mode, preview documents share the host origin; use SandboxContainer + BootOptions.preview.origin when isolating the host application’s origin, cookies, DOM, and storage (threat-model.md).
  • ESM & vm boundaries: Import attributes / JSON modules, data: module URLs, source/defer module imports, and synchronous require() of ESM fail explicitly (ENOSYS / Node module errors). node:vm contexts (createContext, runInContext, Script, compileFunction) use a same-realm approximation rather than separate V8 realms; see architecture.md.
  • Syscall & VFS bounds: Individual JSON syscall payloads are capped at 1 MiB (descriptor reads/writes stream in 64 KiB chunks up to 32 MiB default, 64 MiB max). Default volume quotas enforce 1 GiB total bytes (filesystem.maxTotalBytes), 200,000 inodes (filesystem.maxInodes), 4,096 open descriptors (filesystem.maxOpenDescriptors), and 64 live guest processes/threads (child.maxProcesses). File permissions evaluate owner bits only (umask is 0).
  • Stream & codec nuances: When _final fails synchronously inside end(cb), readable-stream invokes the end callback before 'error'. zlib runs on the guest Worker thread rather than a background native thread pool; Deflate.prototype.params() throws ENOSYS; in 32-bit WASM BrotliCompress supports BROTLI_PARAM_LGWIN up to 27 (BrotliDecompress decodes up to 30), and ZstdCompress clamps ZSTD_c_windowLog 31 to 30 single-threaded.
  • Networking & TLS: Preview HTTP and Fetch-mode outbound HTTP operate at the HTTP message/stream layer rather than raw TCP/TLS sockets; node:tls socket connections, node:http2 sessions, node:dgram, node:dns wire lookups, and native C++ addons (.node / N-API) reject explicitly with ENOSYS.
  • Advisory memory reporting & scheduling: v8.getHeapStatistics(), process.memoryUsage(), and os.freemem() report coarsened, page-wide browser heap figures when exposed by Chromium (throwing ENOSYS when unavailable). Event-loop scheduling uses browser Worker task/microtask queues rather than libuv phases, and CPU/heap per Worker are bounded by kill() / teardown() rather than preemptive OS quotas.
  • Per-origin preview cookies & compression: In origin mode, cookies live in an in-memory per-container/per-origin runtime jar (not persisted across container restarts), SameSite is judged by origin, and the preview worker decodes gzip and RFC 1950 deflate bodies transparently while raw deflate bodies reject on read.