Post

A @nodejs `VirtualFileSystem` pairs a storage provider (memory, a real directory, or a ZIP) with an fs-like API. Mount it, and `node:fs` operations and the module loader recognize it. No special asset API, no rewriting every dependency.

Core support shipped across 26.4.0 → 26.10.0: module-loader integration, the ZIP provider, native-addon loading, Single Executable Application support, and VFS-backed `node:ffi`. Still experimental, it needs `--experimental-vfs`, but this is dropping soon!

The mount model changed from the original proposal. `mount()` takes no target; Node picks a reserved namespace for each instance. No more overlay questions like: does the virtual file win, or do we fall through to disk? Every path under a mount belongs to that VFS.

You can build a ZIP with `node:zlib` and mount it, then `import()` the entry point straight out of the archive. Your application code doesn't need to know which provider stores its files.

Native addons work too. The OS loader can't open a virtual path, so Node reads the bytes and creates a private, self-cleaning image (an in-memory fd on Linux, temp files elsewhere). Same for shared libraries via `node:ffi`.

0 reposts1 like

One correction worth flagging: VFS is not a sandbox. Mounting doesn't stop code from touching other real paths or spawning processes. Untrusted code still needs a real isolation boundary.