File: worker.js

package info (click to toggle)
node-worker-loader 3.0.8-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,624 kB
  • sloc: javascript: 1,720; makefile: 4
file content (9 lines) | stat: -rw-r--r-- 194 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
onmessage = async function(event) {
  const workerResult = event.data;

  const wasm = await import('./add.wasm');

  workerResult.onmessage = wasm.add(10, 20);

  postMessage(workerResult);
};