Uniform.TS β A modern replacement for all my web workers libraries.
Note: The project is being revived. There are no guarantees of stability yet, but new architectural ideas and sketches are in progress.
- Unified approach to working with web workers
- New architectural patterns
- Not based on any organic principles
Host:
import { importModuleInChannel } from "fest/uniform";
//
const module = await importModuleInChannel("test", new URL("./module.ts", import.meta.url).href);
console.log(await module?.remoteFunction(1, 2));
//
const r2 = await (await module?.createArrayBuffer(10))?.transfer?.();
console.log(r2);Worker:
export const remoteFunction = (a: number, b: number) => {
return a + b;
};
export const createArrayBuffer = (length: number) => {
return new ArrayBuffer(length);
};npm install -D @fest-lib/uniform
# or
yarn add @fest-lib/uniformWe welcome your pull requests and issues!
Uniform.TS β a modern approach to working with web workers!