3.0.0 • Published 27 days ago

workered v3.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
27 days ago

Workered

DO NOT CONFUSE WITH WORKERD by CLOUDFLARE

Call in the client with

import { Thread } from "workered";
const w = new Thread( "worker.ts" );

// (<func>, param[])
w.run( "fib", [ 10 ] ).then( res =>
  console.log("Fibonacci of 10 is", res)
);

And in the worker file

import { Host } from "workered";
function fib (n: number): number {/*Calculate Fibonacci*/};
async function todo (msg: string): Promise<string> {/*Do something*/};

new Host()
  .register("fib", fib)
  .register("todo", todo);

Notes

  • Params must be string | number | boolean
3.0.0

27 days ago

2.0.0

1 year ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago