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 e2cebd539403475e2f4e79d55ca1a84a0ce3510d 9 lines 277 B view raw
1import { mo } from '../../src/index.ts'; 2 3export const processImage = mo(import.meta, (pixels: Uint8Array): Uint8Array => { 4 // Invert each pixel (simulate image processing) 5 for (let i = 0; i < pixels.length; i++) { 6 pixels[i] = 255 - pixels[i]; 7 } 8 return pixels; 9});