function-worker
v1.0.3
Published
It does not need to pass in external JS files, but directly executes the worker of local JS functions
Downloads
19
Maintainers
Readme
function-worker
usage
We usually create workers in this way
const myWorker = new Worker(aURL, options);There is a big drawback to this approach,You have to create a JS before you reference it
If we want to run a function in worker,it will be better
const localWorker = require('function-worker')
const worker = localWorker(function () {
// Code you want to run in worker
})
// or the same effect
const worker = localWorker.getWorker(function () {
// Code you want to run in worker
})