NodepodOptions
Nodepod API / src / NodepodOptions
Interface: NodepodOptions
Section titled “Interface: NodepodOptions”Defined in: src/sdk/types.ts:29
Properties
Section titled “Properties”allowedFetchDomains?
Section titled “allowedFetchDomains?”
optionalallowedFetchDomains?:string[] |null
Defined in: src/sdk/types.ts:101
domains allowed through the cors proxy. merged with built-in defaults (npm, github, esm.sh etc). pass null to allow everything
enableSharedArrayBuffer?
Section titled “enableSharedArrayBuffer?”
optionalenableSharedArrayBuffer?:boolean
Defined in: src/sdk/types.ts:91
set to false to force SAB off even if the runtime has it. useful for envs without COOP/COEP or for testing partial mode. when off: execSync/spawnSync throw on call, threaded wasi modules (rolldown, lightningcss, tailwind-oxide) refuse to load, and cross thread vfs reads fall back to async message passing. defaults to true.
enableSnapshotCache?
Section titled “enableSnapshotCache?”
optionalenableSnapshotCache?:boolean
Defined in: src/sdk/types.ts:79
Cache installed node_modules in IndexedDB for faster re-boots. Default: true.
optionalenv?:Record<string,string>
Defined in: src/sdk/types.ts:35
files?
Section titled “files?”
optionalfiles?:Record<string,string|Uint8Array<ArrayBufferLike>>
Defined in: src/sdk/types.ts:34
headless?
Section titled “headless?”
optionalheadless?:boolean
Defined in: src/sdk/types.ts:42
Headless mode: no terminal/preview UI required. Defaults serviceWorker
and watermark to false (can still be overridden). Implied when importing
from @scelar/nodepod/headless.
memory?
Section titled “memory?”
optionalmemory?:MemoryHandlerOptions
Defined in: src/sdk/types.ts:77
Memory optimization settings. Omit to use defaults.
onServerReady?
Section titled “onServerReady?”
optionalonServerReady?: (port,url) =>void
Defined in: src/sdk/types.ts:73
Called after a server’s reported preview URL is ready to navigate to.
Parameters
Section titled “Parameters”number
string
Returns
Section titled “Returns”void
packageStore?
Section titled “packageStore?”
optionalpackageStore?:"auto"|"memory"|"opfs"
Defined in: src/sdk/types.ts:82
Package snapshot backend. “auto” currently prefers IndexedDB; explicit “opfs” canaries packfiles and falls back automatically.
preloadEsbuild?
Section titled “preloadEsbuild?”
optionalpreloadEsbuild?:boolean
Defined in: src/sdk/types.ts:116
Start downloading + compiling esbuild-wasm (~10MB) during boot so it’s ready by the time installs or builds need it. The download overlaps Service Worker registration and package installs. Default: false; the engine otherwise initializes automatically on first use.
previewOrigin?
Section titled “previewOrigin?”
optionalpreviewOrigin?:PreviewOriginOption
Defined in: src/sdk/types.ts:65
Hostname used for virtual server previews. The default, "auto", uses
http(s)://{instanceId}-{port}.localhost:<host-port> on local loopback
pages and falls back to /__virtual__/... elsewhere.
Production hosts can provide a template such as
https://{instanceId}-{port}.preview.example.com. Set false to always
use path URLs.
profiler?
Section titled “profiler?”
optionalprofiler?:ProfilerOptions
Defined in: src/sdk/types.ts:33
Opt-in Nodepod subsystem profiling. Disabled by default.
rewriteTerminalUrls?
Section titled “rewriteTerminalUrls?”
optionalrewriteTerminalUrls?:boolean
Defined in: src/sdk/types.ts:71
Visually rewrite loopback URLs in Nodepod-owned terminals to their real
preview URLs. Raw process stdout/stderr remain unchanged. Defaults to
true.
serviceWorker?
Section titled “serviceWorker?”
optionalserviceWorker?:boolean
Defined in: src/sdk/types.ts:50
Set to false to skip SW registration (SSR, Node tests, or hosts
that don’t need preview iframes / virtual HTTP servers). Defaults to
true when navigator.serviceWorker is available, or false in headless.
sharedVFSBufferSize?
Section titled “sharedVFSBufferSize?”
optionalsharedVFSBufferSize?:number
Defined in: src/sdk/types.ts:98
capacity in bytes of the SharedArrayBuffer-backed fs mirror used by workers and WASI modules. default is 256 MiB — enough for typical app dependency trees including WASM toolchains. must be set before boot because a SharedArrayBuffer cannot grow after workers receive it.
shell?
Section titled “shell?”
optionalshell?:ShellOptions
Defined in: src/sdk/types.ts:31
Shell policy shared by the pod’s terminal and spawned processes.
skipSWPreflight?
Section titled “skipSWPreflight?”
optionalskipSWPreflight?:boolean
Defined in: src/sdk/types.ts:55
Skip the HEAD preflight on the SW URL. Use if your host blocks HEAD, requires auth on assets, or otherwise trips the check.
spawnSnapshot?
Section titled “spawnSnapshot?”
optionalspawnSnapshot?:"full"|"lean"
Defined in: src/sdk/types.ts:109
“lean” excludes node_modules/.npm/.cache from per-spawn VFS snapshots; workers fetch those files on demand over a synchronous fs proxy. Cuts per-process memory roughly by the size of node_modules. Requires SharedArrayBuffer (COOP/COEP) — silently falls back to “full” without it. Default: “lean” when SharedArrayBuffer is available, otherwise “full”.
swUrl?
Section titled “swUrl?”
optionalswUrl?:string
Defined in: src/sdk/types.ts:44
URL of the nodepod service worker. Defaults to /__sw__.js.
watermark?
Section titled “watermark?”
optionalwatermark?:boolean
Defined in: src/sdk/types.ts:75
Show a small “nodepod” watermark link in preview iframes. Defaults to true.
workdir?
Section titled “workdir?”
optionalworkdir?:string
Defined in: src/sdk/types.ts:36
workerUrl?
Section titled “workerUrl?”
optionalworkerUrl?:string
Defined in: src/sdk/types.ts:123
URL of the process-worker bundle asset (dist/worker.js). When the asset is reachable, workers boot from it instead of the copy embedded in the library string, saving parse time and heap. Auto-detected next to the built library when omitted; the embedded copy remains the fallback.