function createNodeWorkerHost
Since 0.1.0
createNodeWorkerHost(mods?: NodeWorkerModules): IWorkerHost

Creates an IWorkerHost backed by node:worker_threads.

file: specifiers are passed to the Worker constructor as URL instances (Node rejects file: URLs given as strings); other specifiers pass through as paths.

Parameters

optional
mods: NodeWorkerModules = defaultNodeWorkerModules

Injected Node modules (defaults to real node: built-ins)

Return Type

IWorkerHost

A worker host

Usage

import { createNodeWorkerHost } from "runtime/src/index.ts";