Offload functions to worker threads with shared memory primitives for Node.js.
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 15 lines 468 B view raw
1import { mo } from 'moroutine'; 2 3export const double = mo(import.meta, (x: number) => 2 * x); 4export const add = mo(import.meta, (a: number, b: number) => a + b); 5export const fail = mo(import.meta, (msg: string) => { 6 throw new Error(msg); 7}); 8 9export const failType = mo(import.meta, (msg: string) => { 10 throw new TypeError(msg); 11}); 12 13export const failCause = mo(import.meta, (msg: string) => { 14 throw new Error(msg, { cause: new RangeError('root cause') }); 15});