run-in-worker
v1.0.2
Published
A small module that enable running functions on (html5) worker
Downloads
3
Readme
#run-in-worker A util function that transfer execution of function to a web worker
###How to install
npm i run-in-worker -S
###How to use
var worker = require('run-in-worker');
function add(a, b){
return a + b;
}
var bgAdd = worker.createBGTask(add);
console.log('Adding on main thread, 3 + 7 = ', add(3,7));
console.log('Adding on web worker thread, 3 + 7 = ', bgAdd(3,7));