node-workerize

Easily make function running in worker thread.

Usage no npm install needed!

<script type="module">
  import nodeWorkerize from 'https://cdn.skypack.dev/node-workerize';
</script>

README

node-workerize

Install

npm install node-workerize

Usage

const workerize = require('node-workerize')(__filename)

function sum(a, b) {
    return a + b
}

const workerizeSum = workerize(sum)

workerizeAdd(11, 22).then(result => {
    // result === 33
})