This runtime exposes a sandboxed, in-memory VFS for Node compatibility (node:fs, node:fs/promises).
- Improve ecosystem compatibility for packages that expect
fsAPIs. - Keep strict sandboxing: no access to host physical filesystem.
- Provide deterministic quota and error behavior.
/bundle- Read-only mount reserved for packaged function artifacts.
- Write operations fail with
EROFS.
/tmp- Writable ephemeral mount in memory.
- Subject to quota enforcement.
/dev/null- Virtual sink.
- Writes are discarded; reads return EOF/empty content.
- Host paths are never exposed.
- Only VFS mounts are reachable.
- Escaping via
..is normalized and prevented from leaving root. - Writes outside
/tmpand/dev/nullfail deterministically.
Two quota dimensions are enforced in writable VFS:
- Total writable quota (
vfsTotalQuotaBytes): cumulative bytes across files in/tmp. - Per-file quota (
vfsMaxFileBytes): maximum bytes for a single file.
Default values:
vfsTotalQuotaBytes:10485760(10 MiB)vfsMaxFileBytes:5242880(5 MiB)
Configuration precedence (highest to lowest):
- Function manifest
resources - Runtime global CLI flags (or env vars)
- Built-in defaults
Manifest fields (resources):
vfsTotalQuotaBytesvfsMaxFileBytes
Global CLI flags (thunder start, thunder watch):
--vfs-total-quota-bytes--vfs-max-file-bytes
Global env vars:
EDGE_RUNTIME_VFS_TOTAL_QUOTA_BYTESEDGE_RUNTIME_VFS_MAX_FILE_BYTES
Supported and VFS-backed:
- Sync:
readFileSync,writeFileSync,mkdirSync,readdirSync,statSync,lstatSync,existsSync,accessSync - Callback:
readFile,writeFile,mkdir,readdir,stat,lstat - Promises:
readFile,writeFile,mkdir,readdir,stat,lstat
Not implemented in current VFS phase:
createReadStreamcreateWriteStreamwatch
These fail with deterministic EOPNOTSUPP.
Common deterministic errors:
ENOENT: missing file/dir or missing parent directoryENOTDIR:readdirtarget is not a directoryEISDIR:readFiletarget is a directoryEROFS: write/mkdir attempt on read-only mount (/bundle)ENOSPC: per-file or total quota exceededEOPNOTSUPP: operation not supported in current VFS phase or write outside writable mounts
- VFS state is isolate-scoped and in-memory.
/tmpis ephemeral by design.- Data is not persisted to host disk.
- Start with defaults (
10 MiBtotal,5 MiBper-file). - Increase cautiously for workloads that build temp artifacts.
- Keep limits explicit; do not bind quotas directly to GC heap usage.
{
"resources": {
"vfsTotalQuotaBytes": 10485760,
"vfsMaxFileBytes": 5242880
}
}thunder start \
--vfs-total-quota-bytes 10485760 \
--vfs-max-file-bytes 5242880