var workerpool = require('../../'); // bundles can be generated by running createEmbeddedWorker.js var workerUrl = require('./dist/worker.embedded') // create a worker pool var pool = workerpool.pool(workerUrl); // execute a method pool.exec('fibonacci', [10]) .then(function (result) { log('Result: ' + result); // outputs 55 pool.clear(); }) .catch(function (err) { log('Error: ' + err); }); function log (message) { console.log(message); if (typeof document !== 'undefined') { document.write(message + '
'); } }