createNodeCapabilities
createNodeCapabilities():
PlatformCapabilities
Defined in: packages/runtime/src/platform/node-caps.ts:48
Build PlatformCapabilities for the Node.js host.
Returns
Section titled “Returns”A PlatformCapabilities bound to the current Node process.
Remarks
Section titled “Remarks”Wires capabilities to Node built-ins — node:fs/promises.readFile for
assets, import(dataUri) for ESM evaluation, globalThis.fetch (undici,
Node 18+) for HTTP, and WebAssembly.compile for WASM. All node:*
imports are dynamic so this module stays isomorphic-importable (the
browser bundler just never hits the branches that use them when
createBrowserCapabilities is the one in play).
importEsm rewrites import.meta.url to process.cwd()+"/" before
evaluation — in a data-URI context the real value is the data URI itself,
which breaks Emscripten glue that calls createRequire(import.meta.url).
Consumed by nodeRuntime; prefer that factory for boot flows.
Example
Section titled “Example”import { createNodeCapabilities, createRuntime } from '@fishnet/runtime'
const runtime = createRuntime(createNodeCapabilities())