@geut/wpc

0.0.9 • Public • Published

wpc

Simple RPC solution for Workers, SharedWorkers and ServiceWorkers.

Build Status JavaScript Style Guide standard-readme compliant

Made by GEUT

Install

$ npm install @geut/wpc

Usage

import { WPC } from '@geut/wpc'

// main-thread.js
const rpc = new WPC(/** @type {Worker|MessagePort} */)
rpc.actions({
  ping: () => 'pong'
})

// worker-thread.js
const rpc = new WPC(self)
await rpc.call('ping') // returns pong

Issues

🐛 If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.

Contributing

👥 Ideas and contributions to the project are welcome. You must follow this guideline.

License

MIT © A GEUT project

Readme

Keywords

Package Sidebar

Install

npm i @geut/wpc

Weekly Downloads

1

Version

0.0.9

License

MIT

Unpacked Size

10.9 kB

Total Files

4

Last publish

Collaborators

  • geutuser
  • the-real-dk
  • tinchoz49
  • estebanprimost