NodeJS implementation of WebWorkers
interface Worker {
terminate: void;
postMessage: void;
onmessage: Function;
onerror: Function;
addEventListener: void;
removeEventListener: void;
dispatchEvent: void;
}
const Worker = require('@koeroesi86/node-worker');
const instance = new Worker('ls');
instance.terminate();
Or checkout the pproject and run
yarn example