node-webworker
node-webworker copied to clipboard
Worker from Function
Rather than relying on disk IO, it'd be convenient to pass a function as follows to construct the WebWorker:
const Worker = require('webworker');
const worker = new Worker(function (msg) {
return `message was: "${msg}" (${msg.length} bytes)`;
});
Try this: https://github.com/developit/greenlet