Skip to content

createRuntime

createRuntime(caps, config?): Runtime

Defined in: packages/runtime/src/platform/boot.ts:1272

Build a Runtime from a PlatformCapabilities bag.

PlatformCapabilities

Base capability bag.

RuntimeConfig

Optional RuntimeConfigconfig.capabilities shallow-merges over caps before freezing.

Runtime

A Runtime that boots images against the merged caps.

The factory every per-platform runtime factory (nodeRuntime, browserRuntime, testRuntime) delegates to. Reach for this directly when you need to hand-craft a capability bag (e.g. combining a Node-style loadAsset with a browser-style importEsm in an Electron renderer). The resulting Runtime’s capabilities is frozen.

import { createRuntime, createNodeCapabilities } from '@fishnet/runtime'
const runtime = createRuntime(createNodeCapabilities(), {
capabilities: { fetch: myInstrumentedFetch },
})