createRuntime
createRuntime(
caps,config?):Runtime
Defined in: packages/runtime/src/platform/boot.ts:1272
Build a Runtime from a PlatformCapabilities bag.
Parameters
Section titled “Parameters”Base capability bag.
config?
Section titled “config?”Optional RuntimeConfig — config.capabilities
shallow-merges over caps before freezing.
Returns
Section titled “Returns”A Runtime that boots images against the merged caps.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”import { createRuntime, createNodeCapabilities } from '@fishnet/runtime'
const runtime = createRuntime(createNodeCapabilities(), { capabilities: { fetch: myInstrumentedFetch },})