Skip to content

browserRuntime

browserRuntime(config?): Runtime

Defined in: packages/runtime/src/platform/browser.ts:69

Create a Runtime pre-wired for browser hosts.

BrowserRuntimeConfig

Optional BrowserRuntimeConfig. capabilities on the base RuntimeConfig can selectively override individual platform methods (e.g. a worker-safe fetch).

Runtime

A Runtime bound to the current browser globals.

Uses createBrowserCapabilities under the hood, which binds to the browser’s fetch, Blob + URL.createObjectURL (dynamic import(blobUrl) for ESM evaluation), and WebAssembly.compile. Reuse a single runtime across many boots — it holds no per-boot state.

For Node hosts use nodeRuntime; for tests use testRuntime.

import { Unix, stdSystem } from '@fishnet/core'
import { browserRuntime } from '@fishnet/runtime'
const image = await Unix().use(stdSystem()).build()
await using sys = await browserRuntime().boot(image)
await sys.boot()