1.0.1 • Published 11 months ago

@frontend.js/wasm-worker v1.0.1

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

WasmWorker

An effortless approach to executing webassembly within a web worker thread and communicating with it via the main thread

How to use WasmWorker

npm install @frontend.js/wasm-worker
import { WasmWorker } from '@frontend.js/wasm-worker'

const module = await new WasmWorker('/release.wasm')
  
module.add(1, 2)
  .then(console.log) // outputs 3

When you initialize WasmWorker with a string specifying the path to the wasm package, the wasm file is downloaded and a promise is returned. This promise, once resolved, will return an object containing functions representing all the exported values from the wasm file

1.0.1

11 months ago

1.0.0

11 months ago