0.2.0 • Published 3 years ago

worker-fns v0.2.0

Weekly downloads
-
License
CC0-1.0
Repository
github
Last release
3 years ago

worker-fns

Collection of Modern Worker Utility Functions

features

  • modern ES6 syntax
  • cross-platform (works on the Web and in NodeJS)
  • automatically create transfer list

functions

Documentation for the following can be found here

install

npm install worker-fns

simple example

import { postMessageWithAutoTransfer } from 'worker-fns';

const worker = new Worker("./worker.js");
const response = await fetch("./example.dat");
const data = await response.arrayBuffer();

// automatically transfer ownership of array buffer
// to the worker thread avoiding unecessarily copying the data
postMessageWithAutoTransfer(worker, data);
0.2.0

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago

1.0.0

6 years ago