1.0.2 • Published 7 years ago

run-in-worker v1.0.2

Weekly downloads
2
License
MIT
Repository
-
Last release
7 years ago

#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));