@frontend.js/wasm-worker

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @frontend.js/wasm-worker

Weekly Downloads

1

Version

1.0.1

License

none

Unpacked Size

55.9 kB

Total Files

13

Last publish

Collaborators

  • lmckeen