Skip to content

Nodepod

Nodepod API


Nodepod API / src / Nodepod

Defined in: src/sdk/nodepod.ts:121

readonly fs: NodepodFS

Defined in: src/sdk/nodepod.ts:122


readonly inspect: PreviewInspector

Defined in: src/sdk/nodepod.ts:125

Opt-in inspection of a host-owned preview iframe.


readonly instanceId: string

Defined in: src/sdk/nodepod.ts:129

unique id used by RequestProxy + SW to route back to this Nodepod when multiple coexist on one page


readonly profiler: NodepodProfiler

Defined in: src/sdk/nodepod.ts:123

get cwd(): string

Defined in: src/sdk/nodepod.ts:1404

string


get engine(): never

Defined in: src/sdk/nodepod.ts:1389

Main-thread engine removed for security. all code now runs in isolated Web Workers via spawn() <– this removes fatal security flaws.

never


get isHeadless(): boolean

Defined in: src/sdk/nodepod.ts:647

Whether this instance was booted in headless mode.

boolean


get isSharedArrayBufferEnabled(): boolean

Defined in: src/sdk/nodepod.ts:1408

true if SAB features are active on this instance

boolean


get packages(): DependencyInstaller

Defined in: src/sdk/nodepod.ts:1395

DependencyInstaller


get persistence(): WorkspacePersistence | null

Defined in: src/sdk/nodepod.ts:1385

Workspace persistence, when booted with the persistence option and a store was available.

WorkspacePersistence | null


get processManager(): ProcessManager

Defined in: src/sdk/nodepod.ts:1401

ProcessManager


get proxy(): RequestProxy

Defined in: src/sdk/nodepod.ts:1398

RequestProxy


get sharedFSBuffer(): SharedArrayBuffer | null

Defined in: src/sdk/nodepod.ts:1345

postMessage this to a sibling worker (one the host app spawned, not one nodepod spawned via spawn()), then call Nodepod.attachFS(buffer) on the other side. null if SAB is unavailable, but boot() would have thrown in that case so this is mostly defensive.

default capacity is 256 MiB (or sharedVFSBufferSize at boot), 65,536 entries, 248-byte paths. writes past either cap count as dropped writes so callers can detect an undersized mirror.

SharedArrayBuffer | null


get volume(): MemoryVolume

Defined in: src/sdk/nodepod.ts:1381

MemoryVolume

clearPreviewScript(): Promise<void>

Defined in: src/sdk/nodepod.ts:1122

Promise<void>


createTerminal(opts): NodepodTerminal

Defined in: src/sdk/nodepod.ts:841

TerminalOptions

NodepodTerminal


memoryStats(): object

Defined in: src/sdk/nodepod.ts:1256

object

engine: object

moduleCacheSize: number

transformCacheApproxBytes: number

transformCacheSize: number

heap: { limitMB: number; totalMB: number; usedMB: number; } | null

runtime: object

budgetMB: number

messagePorts: number

pendingHttp: number

processes: number

sharedFSAllocated: boolean

sharedFSBytes: number

sharedFSUsedBytes: number

wasmCacheEntries: number

workers: number

vfs: object

dirCount: number

fileCount: number

lazyResidentBytes: number

packedBytes: number

Their size, uncompressed.

packedFiles: number

Package files kept deflated in memory (memory.packPackageContent).

packedStoredBytes: number

What they take in memory.

pagedOutBytes: number

pagedOutFiles: number

Package files paged out of memory (memory.evictPackageContent).

pagedOutSyncMisses: number

Synchronous reads that hit paged-out content (should stay 0).

residentPackBytes: number

Paged-in package content currently held, bounded by the resident budget.

totalBytes: number

watcherCount: number


performanceStats(): PerformanceStats

Defined in: src/sdk/nodepod.ts:1252

PerformanceStats


port(num): string | null

Defined in: src/sdk/nodepod.ts:1131

number

string | null


request(port, init?): Promise<CompletedResponse>

Defined in: src/sdk/nodepod.ts:655

Programmatic HTTP against a virtual server registered on this instance. Works without Service Worker / preview iframes (headless-friendly).

number

NodepodRequestOptions = {}

Promise<CompletedResponse>


restore(snapshot, opts?): Promise<void>

Defined in: src/sdk/nodepod.ts:1161

VolumeSnapshot

SnapshotOptions

Promise<void>


setPreviewScript(script): Promise<void>

Defined in: src/sdk/nodepod.ts:1117

string

Promise<void>


snapshot(opts?): VolumeSnapshot

Defined in: src/sdk/nodepod.ts:1146

SnapshotOptions

VolumeSnapshot


spawn(cmd, args?, opts?): Promise<NodepodProcess>

Defined in: src/sdk/nodepod.ts:702

string

string[]

SpawnOptions

Promise<NodepodProcess>


teardown(): Promise<void>

Defined in: src/sdk/nodepod.ts:1196

Release workers, servers, the SW slot and (headless) the loopback ingress. Everything synchronous happens before the first await, so un-awaited callers still get the old fire-and-forget behaviour; awaiting additionally waits for the ingress socket and its keep-alive connections to close.

Promise<void>


static attachFS(buffer): NodepodFSClient

Defined in: src/sdk/nodepod.ts:1370

attach to an existing nodepod from a sibling worker using the buffer from nodepod.sharedFSBuffer. the returned client is read-only, writes throw ENOTSUP.

SharedArrayBuffer

NodepodFSClient


static boot(opts?): Promise<Nodepod>

Defined in: src/sdk/nodepod.ts:308

NodepodOptions = {}

Promise<Nodepod>