@giuem/worker
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Worker (Experiment)

Make WebWorker great again.

Example

import { makeWorker } from '@giuem/worker';

function fibonacci(n) {
  if(n==0 || n == 1) return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
}

const worker = makeWorker(fibonacci)

worker
  .exec(20)
  .then(console.log)
  .finally(() => {
    worker.terminate()
  })

Readme

Keywords

none

Package Sidebar

Install

npm i @giuem/worker

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

13.6 kB

Total Files

10

Last publish

Collaborators

  • giuem