securityos/node_modules/comlink/tests/node/worker.mjs

6 lines
220 B
JavaScript

import { parentPort } from "worker_threads";
import * as Comlink from "../../dist/esm/comlink.mjs";
import nodeEndpoint from "../../dist/esm/node-adapter.mjs";
Comlink.expose((a, b) => a + b, nodeEndpoint(parentPort));