{"_id":"@chainsafe/threads","_rev":"11-2d59ce14ac3017a3a535f046dbc55d97","name":"@chainsafe/threads","dist-tags":{"latest":"1.11.3"},"versions":{"1.8.0":{"name":"@chainsafe/threads","version":"1.8.0","keywords":["thread","worker","pool","spawn","isomorphic","parallel","observable","worker_threads"],"author":{"url":"https://github.com/andywer","name":"Andy Wermke"},"license":"MIT","_id":"@chainsafe/threads@1.8.0","maintainers":[{"name":"dapplion","email":"dapplion@chainsafe.io"},{"name":"wemeetagain","email":"caymannava@gmail.com"},{"name":"mpetrunic","email":"marin@nodefactory.io"}],"homepage":"https://threads.js.org","bugs":{"url":"https://github.com/andywer/threads.js/issues"},"ava":{"files":["./test/**/*.test.ts","./test-tooling/**/*.test.ts"],"serial":true,"require":["ts-node/register"],"extensions":["ts"]},"dist":{"shasum":"f5d904c7ba14df4a368e51170e90a064c052dee6","tarball":"https://registry.npmjs.org/@chainsafe/threads/-/threads-1.8.0.tgz","fileCount":104,"integrity":"sha512-qty6cLwn5E0tUXzV+9yCNnkmllUCxNpiy78W1soCRpdS3Zs2CUoWaS/02AyrdZq3lPtofKAv5Z8zTAHNLnDzbQ==","signatures":[{"sig":"MEQCIFi1jrZnEh1JoYz4rUCvNNv/kTtw+pFoKgZ25zqjKcWQAiB9iLgDggr/k9RHdTdoXwl9N5Bl5bQG62mvV42q9PS4cw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":179208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVHzsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+sA/+OoA0XjZgVPu4vrYBA8//4bc/aHbJF8nkNjIDuKlzZSlzASaj\r\n0caLC4Ah2n1i8DXKvaUm0318/QYvKcoldnrJVKaiXowkWIu8elwBwy7C7gEg\r\ns7MsjaRVPWqqoNeKygehAK79yf6PlGdj9k36ycmLvBayzw47NeplSN2MJ6e/\r\nbiA3SRRjhQrCNKMJiOB1Jo8gVmro4I+C6lkp6EujBpZPmv0nhVWBQ8+Jj5zI\r\nv5fJO0onF7cTQSRI5RJWa6PbgfEYCxdhbGdjHP2UD25hjGLUWflBzjab5vu7\r\n+Ed6rgS+jWY0fJPKzZp95J/1sbr/ObSAg8XgKQxxGNmggV02lz2FV4dokJ+6\r\nQ3migb1UGXWFBKGFcfAO/xBq8VbYDIpj20bW4aaJuLeifxVNZW1a7rRR7h0D\r\nFGv4o9prDD76YOaRIn8ez6IBkI7O/H5yC1cTW34XGb1qBwu56I97kuB1B/7L\r\n913u87l3LoWXqa/fCCf3cvgH4LIt55OznXqDW9CsysQ6gwDkB9kKh8ENCMDH\r\nwVD12E7NlAeRk6Zo+SFOLjdMmWHFLo8Nl/sR5wA/mWkip+3DhW9BkcLhbrgB\r\nopo2juUn2n853+kFKjy4/xLDAN240gIszJnD9Khm4NhNE9e0iLl6dY0/5l7a\r\nLXjNQQ9zIpIEFHXNhP81IaSorAE2sicafOY=\r\n=Cy/b\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"./dist/index.d.ts","module":"dist-esm/index.js","browser":{"ts-node":false,"callsites":false,"tiny-worker":false,"worker_threads":false,"ts-node/register":false,"./dist/master/implementation.js":"./dist/master/implementation.browser.js","./dist/worker/implementation.js":"./dist/worker/implementation.browser.js","./dist-esm/master/implementation.js":"./dist-esm/master/implementation.browser.js","./dist-esm/worker/implementation.js":"./dist-esm/worker/implementation.browser.js","./dist/master/implementation.node.js":false,"./dist-esm/master/implementation.node.js":false,"./dist/worker/implementation.tiny-worker.js":false,"./dist/worker/implementation.worker_threads.js":false,"./dist-esm/worker/implementation.tiny-worker.js":false,"./dist-esm/worker/implementation.worker_threads.js":false},"exports":{".":{"default":"./index.mjs","require":"./dist/index.js"},"./worker":{"default":"./worker.mjs","require":"./worker.js"},"./register":{"default":"./register.mjs","require":"./register.js"},"./observable":{"default":"./observable.mjs","require":"./observable.js"}},"funding":"https://github.com/andywer/threads.js?sponsor=1","gitHead":"dee88c343c1a01931ea7516fe90c3b821e26d8c7","scripts":{"dev":"npm run clean && tsc -p tsconfig.json --watch","test":"npm run test:library && npm run test:tooling && npm run test:puppeteer:basic && npm run test:puppeteer:webpack","build":"npm run clean && npm run build:cjs && npm run build:es","clean":"rimraf dist/ dist-esm/","bundle":"rollup -c -f umd --file=bundle/worker.js --name=threads --silent -- dist-esm/worker/bundle-entry.js","prepare":"npm run build","build:es":"tsc -p tsconfig-esm.json","posttest":"tslint --project .","build:cjs":"tsc -p tsconfig.json","postbuild":"npm run bundle","test:library":"cross-env TS_NODE_FILES=true ava ./test/**/*.test.ts","test:tooling":"cross-env TS_NODE_FILES=true ava ./test-tooling/**/*.test.ts","test:puppeteer:basic":"puppet-run --plugin=mocha --bundle=./test/workers/:workers/ --serve=./bundle/worker.js:/worker.js ./test/*.chromium*.ts","test:puppeteer:webpack":"puppet-run --serve ./test-tooling/webpack/dist/app.web/0.worker.js --serve ./test-tooling/webpack/dist/app.web/1.worker.js --plugin=mocha ./test-tooling/webpack/webpack.chromium.mocha.ts"},"_npmUser":{"name":"wemeetagain","email":"caymannava@gmail.com"},"repository":{"url":"git+https://github.com/andywer/threads.js.git","type":"git"},"_npmVersion":"8.1.2","description":"Web workers & worker threads as simple as a function call","directories":{},"sideEffects":["./dist*/master/register.js","./dist*/worker/index.js","./register.*js","./worker.*js"],"_nodeVersion":"16.13.1","dependencies":{"debug":"^4.2.0","callsites":"^3.1.0","tiny-worker":">= 2","is-observable":"^2.1.0","observable-fns":"^0.6.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","chai":"^4.2.0","wavy":"^1.0.4","execa":"^4.0.3","mocha":"^8.2.0","rimraf":"^3.0.2","rollup":"^2.32.1","tslint":"^6.1.3","ts-node":"^9.0.0","webpack":"^4.44.2","cross-env":"^7.0.2","ts-loader":"^8.0.7","puppet-run":"^0.11.3","raw-loader":"^4.0.2","typescript":"^4.2.3","@types/chai":"^4.2.14","@types/node":"^14.14.5","tiny-worker":"^2.2.0","@types/debug":"^4.1.5","@types/execa":"^2.0.0","@types/mocha":"^8.0.3","worker-plugin":"^5.0.0","@types/webpack":"^4.41.23","threads-plugin":"^1.3.3","tslint-config-prettier":"^1.18.0","@rollup/plugin-commonjs":"^16.0.0","puppet-run-plugin-mocha":"^0.10.0-alpha","@rollup/plugin-node-resolve":"^10.0.0"},"optionalDependencies":{"tiny-worker":">= 2"},"_npmOperationalInternal":{"tmp":"tmp/threads_1.8.0_1649704172624_0.23064114147444692","host":"s3://npm-registry-packages"}},"1.9.0":{"name":"@chainsafe/threads","version":"1.9.0","keywords":["thread","worker","pool","spawn","isomorphic","parallel","observable","worker_threads"],"author":{"url":"https://github.com/andywer","name":"Andy Wermke"},"license":"MIT","_id":"@chainsafe/threads@1.9.0","maintainers":[{"name":"dapplion","email":"dapplion@chainsafe.io"},{"name":"wemeetagain","email":"caymannava@gmail.com"},{"name":"mpetrunic","email":"marin@nodefactory.io"}],"homepage":"https://threads.js.org","bugs":{"url":"https://github.com/andywer/threads.js/issues"},"ava":{"files":["./test/**/*.test.ts","./test-tooling/**/*.test.ts"],"serial":true,"require":["ts-node/register"],"extensions":["ts"]},"dist":{"shasum":"5ab07b1c150ad6ffc2325f344cde549a96b53802","tarball":"https://registry.npmjs.org/@chainsafe/threads/-/threads-1.9.0.tgz","fileCount":104,"integrity":"sha512-TFSj5CWwi2o0Z3qBdrROdR+mJ23reBm+e0iPaifn657AxNtatdHNV9l6DiNwOKHTxTxKTm1daVuWW5TP0dJGDw==","signatures":[{"sig":"MEQCIF6sMOcZi5Z9a1Sd1nZfqrvpTNfOg0h6K8HUeJzNoru6AiBZI8LJGRSlw9lFj4Pa3hVob3tWlhzbR4l4inUdHEZYeQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":179496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVIkLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxYQ//eKlj4OixN3kYQIMUi3f3dwvF9WvkEYWXdg9raEsQTzXcevvI\r\nq8K5jI3ZUkUum4cQIG3y/u/rQXSzhkQ+74Bq2qg0hxemJp/OSAulSv7Xvo0E\r\n0PS+zdy+rTkmEaFrVpDaJ4vNp9p6S8/JaiOgK/V08ekQ4mBpmIvzJA8LFTuW\r\n4cEHdPbYkBWYAj5n0AcWOidLYcii2AI0B0FEXD6MI8Xi4SJJMik3R1QNtfLp\r\nUsmRAVjSQwYBaQTVhjo2d7YEa0SsnoxMY48FGC4yA+JEq7tXAuHkUq4WQHsJ\r\nRkR8SeeUYGvdS8seLqagVLJI2qeKETuaxU65+lvRiejmf+XL4RGiOyGp4XOb\r\nBDVBLDwf7+ap2W1zCZKsBvhGQ/978/l55vwnaflf3blHrfv/XRz+senXS4fF\r\nZx4sxEqHbTm0gZJqyu+ipjrM3QOatMPpmXrRNuNdLN2xGTyWBVJP/HA7WDNl\r\nhZ2LEgtbnN6CptQz/ghOycdcPJcz3JoSdCawYMdmz/qraxteDG9D0yjFNDbl\r\nB88L08oeFBDCYVpxeke2Qwqt4AKCh9Zc/DfaPfrehM3wFsTlk/Bu4KSmMJw9\r\n2pp9TsHkT8vgRcyRjnYoYiXWC6VacjQyGK/k6Lk8sigp5TmkWDA/31ZmPRkd\r\n/R9u9E2f0nylL20mNuzddU3tvOWkzIK6/ws=\r\n=ofZP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"./dist/index.d.ts","module":"dist-esm/index.js","browser":{"ts-node":false,"callsites":false,"tiny-worker":false,"worker_threads":false,"ts-node/register":false,"./dist/master/implementation.js":"./dist/master/implementation.browser.js","./dist/worker/implementation.js":"./dist/worker/implementation.browser.js","./dist-esm/master/implementation.js":"./dist-esm/master/implementation.browser.js","./dist-esm/worker/implementation.js":"./dist-esm/worker/implementation.browser.js","./dist/master/implementation.node.js":false,"./dist-esm/master/implementation.node.js":false,"./dist/worker/implementation.tiny-worker.js":false,"./dist/worker/implementation.worker_threads.js":false,"./dist-esm/worker/implementation.tiny-worker.js":false,"./dist-esm/worker/implementation.worker_threads.js":false},"exports":{".":{"default":"./index.mjs","require":"./dist/index.js"},"./worker":{"default":"./worker.mjs","require":"./worker.js"},"./register":{"default":"./register.mjs","require":"./register.js"},"./observable":{"default":"./observable.mjs","require":"./observable.js"}},"funding":"https://github.com/andywer/threads.js?sponsor=1","gitHead":"4ab118ae8b7968f0a23cfb289a608c896622ffa1","scripts":{"dev":"npm run clean && tsc -p tsconfig.json --watch","test":"npm run test:library && npm run test:tooling && npm run test:puppeteer:basic && npm run test:puppeteer:webpack","build":"npm run clean && npm run build:cjs && npm run build:es","clean":"rimraf dist/ dist-esm/","bundle":"rollup -c -f umd --file=bundle/worker.js --name=threads --silent -- dist-esm/worker/bundle-entry.js","prepare":"npm run build","build:es":"tsc -p tsconfig-esm.json","posttest":"tslint --project .","build:cjs":"tsc -p tsconfig.json","postbuild":"npm run bundle","test:library":"cross-env TS_NODE_FILES=true ava ./test/**/*.test.ts","test:tooling":"cross-env TS_NODE_FILES=true ava ./test-tooling/**/*.test.ts","test:puppeteer:basic":"puppet-run --plugin=mocha --bundle=./test/workers/:workers/ --serve=./bundle/worker.js:/worker.js ./test/*.chromium*.ts","test:puppeteer:webpack":"puppet-run --serve ./test-tooling/webpack/dist/app.web/0.worker.js --serve ./test-tooling/webpack/dist/app.web/1.worker.js --plugin=mocha ./test-tooling/webpack/webpack.chromium.mocha.ts"},"_npmUser":{"name":"wemeetagain","email":"caymannava@gmail.com"},"repository":{"url":"git+https://github.com/andywer/threads.js.git","type":"git"},"_npmVersion":"8.1.2","description":"Web workers & worker threads as simple as a function call","directories":{},"sideEffects":["./dist*/master/register.js","./dist*/worker/index.js","./register.*js","./worker.*js"],"_nodeVersion":"16.13.1","dependencies":{"debug":"^4.2.0","callsites":"^3.1.0","tiny-worker":">= 2","is-observable":"^2.1.0","observable-fns":"^0.6.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","chai":"^4.2.0","wavy":"^1.0.4","execa":"^4.0.3","mocha":"^8.2.0","rimraf":"^3.0.2","rollup":"^2.32.1","tslint":"^6.1.3","ts-node":"^9.0.0","webpack":"^4.44.2","cross-env":"^7.0.2","ts-loader":"^8.0.7","puppet-run":"^0.11.3","raw-loader":"^4.0.2","typescript":"^4.2.3","@types/chai":"^4.2.14","@types/node":"^14.14.5","tiny-worker":"^2.2.0","@types/debug":"^4.1.5","@types/execa":"^2.0.0","@types/mocha":"^8.0.3","worker-plugin":"^5.0.0","@types/webpack":"^4.41.23","threads-plugin":"^1.3.3","tslint-config-prettier":"^1.18.0","@rollup/plugin-commonjs":"^16.0.0","puppet-run-plugin-mocha":"^0.10.0-alpha","@rollup/plugin-node-resolve":"^10.0.0"},"optionalDependencies":{"tiny-worker":">= 2"},"_npmOperationalInternal":{"tmp":"tmp/threads_1.9.0_1649707275009_0.9709525100163687","host":"s3://npm-registry-packages"}},"1.10.0":{"name":"@chainsafe/threads","version":"1.10.0","keywords":["thread","worker","pool","spawn","isomorphic","parallel","observable","worker_threads"],"author":{"url":"https://github.com/andywer","name":"Andy Wermke"},"license":"MIT","_id":"@chainsafe/threads@1.10.0","maintainers":[{"name":"dapplion","email":"dapplion@chainsafe.io"},{"name":"wemeetagain","email":"caymannava@gmail.com"},{"name":"mpetrunic","email":"marin@nodefactory.io"}],"homepage":"https://threads.js.org","bugs":{"url":"https://github.com/andywer/threads.js/issues"},"ava":{"files":["./test/**/*.test.ts","./test-tooling/**/*.test.ts"],"serial":true,"require":["ts-node/register"],"extensions":["ts"]},"dist":{"shasum":"1b98eccb2791f0737b2d8ddf56e8c2fc3c45162c","tarball":"https://registry.npmjs.org/@chainsafe/threads/-/threads-1.10.0.tgz","fileCount":104,"integrity":"sha512-1PRtW3s5welk2WUAMN0bjEGtQ3PSqLWAxlMTSeOYJ2NV+bgNgi8PsALX/xEiB/CHd8XG5gS2BlmYZ+Q3b4wR7Q==","signatures":[{"sig":"MEUCIGyG/8wE6HYpcJBjZHUz7lqOi+4wZGXrBax0ALvVtD5NAiEArswqCvaLIFcnEtYl8Ug3B7XNbPcEZM0QMOvfAbVvrA0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":179783,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifQpCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfFw//TDnJsQ0/hejxKba+UIvULNS255w0Bvcp0VdD//4TF0GTSpLH\r\n5AOyHtRmBrb/HUeQNO4IPEaZSwH96aNdoxpnomsBjiOZPfvrvQjCfzBMcBly\r\nSx6M9goNMdj5XrtrRIyK0dD4rmCBIW8IIwMvgcIxMz0DfrKGvNZlIWb7Jqy1\r\nfrCyX2kEBtFMmihksq8DLQfHVPjkkaHUfRn+gnB6n4Ue2i/uzdmztc40vgQ6\r\ntQB1m0UFubbWlTIR8jGFL66AH6Rrn5uDR+saONZ96qbgKjh/dPFZc/0XfvpD\r\n3oKxMkFkwR2KXZAImI3E1pC0hmcQR3O40eYsdGGdQbzuhG4Z1T7uHS9TEZEy\r\nCm+kEiSpInlJ3Ue6b7r3sYr87zfC0dfmExBjmdg/hot2vPETv2tiywsp+c1i\r\nwEBVUNQ1AAhLrSvar6s97aGd9yrnRtljWLdYwNk5RdpMPSOHzPPSVyz0iJun\r\nMQF7GGGWQUCxXAytPIgnNL1ohvCI91EWJhParh2B1SWZCHZ9ymW0VdQyF3qh\r\nbjYd6ThYQEHn29FqGEzSUy8Yu0n9V4JEqf88NaSWwq3EzTKGxzatY+5SGXwJ\r\nChfAGbNv4d8eCcMwErn51hQg91M087lylBGVXi2gm/s4osLovR2QwH5wnr1x\r\ntpxRqdKDbO/lkRovoOZF/uqS7OkIggWUBgw=\r\n=/mcx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"./dist/index.d.ts","module":"dist-esm/index.js","browser":{"ts-node":false,"callsites":false,"tiny-worker":false,"worker_threads":false,"ts-node/register":false,"./dist/master/implementation.js":"./dist/master/implementation.browser.js","./dist/worker/implementation.js":"./dist/worker/implementation.browser.js","./dist-esm/master/implementation.js":"./dist-esm/master/implementation.browser.js","./dist-esm/worker/implementation.js":"./dist-esm/worker/implementation.browser.js","./dist/master/implementation.node.js":false,"./dist-esm/master/implementation.node.js":false,"./dist/worker/implementation.tiny-worker.js":false,"./dist/worker/implementation.worker_threads.js":false,"./dist-esm/worker/implementation.tiny-worker.js":false,"./dist-esm/worker/implementation.worker_threads.js":false},"exports":{".":{"default":"./index.mjs","require":"./dist/index.js"},"./worker":{"default":"./worker.mjs","require":"./worker.js"},"./register":{"default":"./register.mjs","require":"./register.js"},"./observable":{"default":"./observable.mjs","require":"./observable.js"}},"funding":"https://github.com/andywer/threads.js?sponsor=1","gitHead":"f45455fbc716320dfd9bc0d7c5a31ad1ef29c59c","scripts":{"dev":"npm run clean && tsc -p tsconfig.json --watch","test":"npm run test:library && npm run test:tooling && npm run test:puppeteer:basic && npm run test:puppeteer:webpack","build":"npm run clean && npm run build:cjs && npm run build:es","clean":"rimraf dist/ dist-esm/","bundle":"rollup -c -f umd --file=bundle/worker.js --name=threads --silent -- dist-esm/worker/bundle-entry.js","prepare":"npm run build","build:es":"tsc -p tsconfig-esm.json","posttest":"tslint --project .","build:cjs":"tsc -p tsconfig.json","postbuild":"npm run bundle","test:library":"cross-env TS_NODE_FILES=true ava ./test/**/*.test.ts","test:tooling":"cross-env TS_NODE_FILES=true ava ./test-tooling/**/*.test.ts","test:puppeteer:basic":"puppet-run --plugin=mocha --bundle=./test/workers/:workers/ --serve=./bundle/worker.js:/worker.js ./test/*.chromium*.ts","test:puppeteer:webpack":"puppet-run --serve ./test-tooling/webpack/dist/app.web/0.worker.js --serve ./test-tooling/webpack/dist/app.web/1.worker.js --plugin=mocha ./test-tooling/webpack/webpack.chromium.mocha.ts"},"_npmUser":{"name":"wemeetagain","email":"caymannava@gmail.com"},"repository":{"url":"git+https://github.com/andywer/threads.js.git","type":"git"},"_npmVersion":"8.1.2","description":"Web workers & worker threads as simple as a function call","directories":{},"sideEffects":["./dist*/master/register.js","./dist*/worker/index.js","./register.*js","./worker.*js"],"_nodeVersion":"16.13.1","dependencies":{"debug":"^4.2.0","callsites":"^3.1.0","tiny-worker":">= 2","is-observable":"^2.1.0","observable-fns":"^0.6.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","chai":"^4.2.0","wavy":"^1.0.4","execa":"^4.0.3","mocha":"^8.2.0","rimraf":"^3.0.2","rollup":"^2.32.1","tslint":"^6.1.3","ts-node":"^9.0.0","webpack":"^4.44.2","cross-env":"^7.0.2","ts-loader":"^8.0.7","puppet-run":"^0.11.3","raw-loader":"^4.0.2","typescript":"^4.2.3","@types/chai":"^4.2.14","@types/node":"^14.14.5","tiny-worker":"^2.2.0","@types/debug":"^4.1.5","@types/execa":"^2.0.0","@types/mocha":"^8.0.3","worker-plugin":"^5.0.0","@types/webpack":"^4.41.23","threads-plugin":"^1.3.3","tslint-config-prettier":"^1.18.0","@rollup/plugin-commonjs":"^16.0.0","puppet-run-plugin-mocha":"^0.10.0-alpha","@rollup/plugin-node-resolve":"^10.0.0"},"optionalDependencies":{"tiny-worker":">= 2"},"_npmOperationalInternal":{"tmp":"tmp/threads_1.10.0_1652361794162_0.5037400649853561","host":"s3://npm-registry-packages"}},"1.11.0":{"name":"@chainsafe/threads","version":"1.11.0","keywords":["thread","worker","pool","spawn","isomorphic","parallel","observable","worker_threads"],"author":{"url":"https://github.com/andywer","name":"Andy Wermke"},"license":"MIT","_id":"@chainsafe/threads@1.11.0","maintainers":[{"name":"dapplion","email":"dapplion@chainsafe.io"},{"name":"wemeetagain","email":"caymannava@gmail.com"},{"name":"mpetrunic","email":"marin@nodefactory.io"}],"homepage":"https://threads.js.org","bugs":{"url":"https://github.com/andywer/threads.js/issues"},"ava":{"files":["./test/**/*.test.ts","./test-tooling/**/*.test.ts"],"serial":true,"require":["ts-node/register"],"extensions":["ts"]},"dist":{"shasum":"4845f452d30901053991cf050696746a442a8933","tarball":"https://registry.npmjs.org/@chainsafe/threads/-/threads-1.11.0.tgz","fileCount":104,"integrity":"sha512-l36K9eXqpE0PTnQThDBrxmkx0DX4UV2Qt0l9ASRHRbCUZW3SlSAS+b0//DfTQ2/OXeDVPuE7/72991lTOaKmdQ==","signatures":[{"sig":"MEUCIQCSI7Fb9csFukdGuh/GYHrpLYGuSGJPAba7GulkR1stmQIgbjuELo5ZCAUPSyYonkCl4PBQQrB5K12aBg/6IsD0Fyg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":176866},"main":"dist/index.js","types":"./dist/index.d.ts","module":"dist-esm/index.js","browser":{"ts-node":false,"callsites":false,"tiny-worker":false,"worker_threads":false,"ts-node/register":false,"./dist/master/implementation.js":"./dist/master/implementation.browser.js","./dist/worker/implementation.js":"./dist/worker/implementation.browser.js","./dist-esm/master/implementation.js":"./dist-esm/master/implementation.browser.js","./dist-esm/worker/implementation.js":"./dist-esm/worker/implementation.browser.js","./dist/master/implementation.node.js":false,"./dist-esm/master/implementation.node.js":false,"./dist/worker/implementation.tiny-worker.js":false,"./dist/worker/implementation.worker_threads.js":false,"./dist-esm/worker/implementation.tiny-worker.js":false,"./dist-esm/worker/implementation.worker_threads.js":false},"exports":{".":{"default":"./index.mjs","require":"./dist/index.js"},"./worker":{"default":"./worker.mjs","require":"./worker.js"},"./register":{"default":"./register.mjs","require":"./register.js"},"./observable":{"default":"./observable.mjs","require":"./observable.js"}},"funding":"https://github.com/andywer/threads.js?sponsor=1","gitHead":"df351552cb7d08b8465f5d1e7c543c952d74ac67","scripts":{"dev":"npm run clean && tsc -p tsconfig.json --watch","test":"npm run test:library && npm run test:tooling && npm run test:puppeteer:basic && npm run test:puppeteer:webpack","build":"npm run clean && npm run build:cjs && npm run build:es","clean":"rimraf dist/ dist-esm/","bundle":"rollup -c -f umd --file=bundle/worker.js --name=threads --silent -- dist-esm/worker/bundle-entry.js","prepare":"npm run build","build:es":"tsc -p tsconfig-esm.json","posttest":"tslint --project .","build:cjs":"tsc -p tsconfig.json","postbuild":"npm run bundle","test:library":"cross-env TS_NODE_FILES=true ava ./test/**/*.test.ts","test:tooling":"cross-env TS_NODE_FILES=true ava ./test-tooling/**/*.test.ts","test:puppeteer:basic":"puppet-run --plugin=mocha --bundle=./test/workers/:workers/ --serve=./bundle/worker.js:/worker.js ./test/*.chromium*.ts","test:puppeteer:webpack":"puppet-run --serve ./test-tooling/webpack/dist/app.web/0.worker.js --serve ./test-tooling/webpack/dist/app.web/1.worker.js --plugin=mocha ./test-tooling/webpack/webpack.chromium.mocha.ts"},"_npmUser":{"name":"wemeetagain","email":"caymannava@gmail.com"},"repository":{"url":"git+https://github.com/andywer/threads.js.git","type":"git"},"_npmVersion":"8.19.3","description":"Web workers & worker threads as simple as a function call","directories":{},"sideEffects":["./dist*/master/register.js","./dist*/worker/index.js","./register.*js","./worker.*js"],"_nodeVersion":"18.13.0","dependencies":{"debug":"^4.2.0","callsites":"^3.1.0","tiny-worker":">= 2","is-observable":"^2.1.0","observable-fns":"^0.6.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","chai":"^4.2.0","wavy":"^1.0.4","execa":"^4.0.3","mocha":"^8.2.0","rimraf":"^3.0.2","rollup":"^2.32.1","tslint":"^6.1.3","ts-node":"^9.0.0","webpack":"^4.44.2","cross-env":"^7.0.2","ts-loader":"^8.0.7","puppet-run":"^0.11.3","raw-loader":"^4.0.2","typescript":"^4.2.3","@types/chai":"^4.2.14","@types/node":"^14.14.5","tiny-worker":"^2.2.0","@types/debug":"^4.1.5","@types/execa":"^2.0.0","@types/mocha":"^8.0.3","worker-plugin":"^5.0.0","@types/webpack":"^4.41.23","threads-plugin":"^1.3.3","tslint-config-prettier":"^1.18.0","@rollup/plugin-commonjs":"^16.0.0","puppet-run-plugin-mocha":"^0.10.0-alpha","@rollup/plugin-node-resolve":"^10.0.0"},"optionalDependencies":{"tiny-worker":">= 2"},"_npmOperationalInternal":{"tmp":"tmp/threads_1.11.0_1684940059372_0.8685132681998384","host":"s3://npm-registry-packages"}},"1.11.1":{"name":"@chainsafe/threads","version":"1.11.1","keywords":["thread","worker","pool","spawn","isomorphic","parallel","observable","worker_threads"],"author":{"url":"https://github.com/andywer","name":"Andy Wermke"},"license":"MIT","_id":"@chainsafe/threads@1.11.1","maintainers":[{"name":"dapplion","email":"dapplion@chainsafe.io"},{"name":"wemeetagain","email":"caymannava@gmail.com"},{"name":"mpetrunic","email":"marin.petrunic@gmail.com"}],"homepage":"https://threads.js.org","bugs":{"url":"https://github.com/andywer/threads.js/issues"},"ava":{"files":["./test/**/*.test.ts","./test-tooling/**/*.test.ts"],"serial":true,"require":["ts-node/register"],"extensions":["ts"]},"dist":{"shasum":"0b3b8c76f5875043ef6d47aeeb681dc80378f205","tarball":"https://registry.npmjs.org/@chainsafe/threads/-/threads-1.11.1.tgz","fileCount":104,"integrity":"sha512-ejkB0eVcM0k2E8n5ZqOGt//ZEWU+c431QS3e/WfjLKxhw/fwZpvYhUOxBA8u3lJmAKLGziIcXjOoTnPwMPhkcQ==","signatures":[{"sig":"MEYCIQCJIH8Jhnb1wkFaV0HtyKfHUgrfy+0ksMhcriq6oRafWwIhAJ30s94GeehmWSN9RZ3BN1U6Rn8vrqJBI3c8gkP4Wyw9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":177420},"main":"dist/index.js","types":"./dist/index.d.ts","module":"dist-esm/index.js","browser":{"ts-node":false,"callsites":false,"tiny-worker":false,"worker_threads":false,"ts-node/register":false,"./dist/master/implementation.js":"./dist/master/implementation.browser.js","./dist/worker/implementation.js":"./dist/worker/implementation.browser.js","./dist-esm/master/implementation.js":"./dist-esm/master/implementation.browser.js","./dist-esm/worker/implementation.js":"./dist-esm/worker/implementation.browser.js","./dist/master/implementation.node.js":false,"./dist-esm/master/implementation.node.js":false,"./dist/worker/implementation.tiny-worker.js":false,"./dist/worker/implementation.worker_threads.js":false,"./dist-esm/worker/implementation.tiny-worker.js":false,"./dist-esm/worker/implementation.worker_threads.js":false},"exports":{".":{"default":"./index.mjs","require":"./dist/index.js"},"./worker":{"default":"./worker.mjs","require":"./worker.js"},"./register":{"default":"./register.mjs","require":"./register.js"},"./observable":{"default":"./observable.mjs","require":"./observable.js"}},"funding":"https://github.com/andywer/threads.js?sponsor=1","gitHead":"2c952a7e738166f62f72cb8a74d0a83003220aeb","scripts":{"dev":"npm run clean && tsc -p tsconfig.json --watch","test":"npm run test:library && npm run test:tooling && npm run test:puppeteer:basic && npm run test:puppeteer:webpack","build":"npm run clean && npm run build:cjs && npm run build:es","clean":"rimraf dist/ dist-esm/","bundle":"rollup -c -f umd --file=bundle/worker.js --name=threads --silent -- dist-esm/worker/bundle-entry.js","prepare":"npm run build","build:es":"tsc -p tsconfig-esm.json","posttest":"tslint --project .","build:cjs":"tsc -p tsconfig.json","postbuild":"npm run bundle","test:library":"cross-env TS_NODE_FILES=true ava ./test/**/*.test.ts","test:tooling":"cross-env TS_NODE_FILES=true ava ./test-tooling/**/*.test.ts","test:puppeteer:basic":"puppet-run --plugin=mocha --bundle=./test/workers/:workers/ --serve=./bundle/worker.js:/worker.js ./test/*.chromium*.ts","test:puppeteer:webpack":"puppet-run --serve ./test-tooling/webpack/dist/app.web/0.worker.js --serve ./test-tooling/webpack/dist/app.web/1.worker.js --plugin=mocha ./test-tooling/webpack/webpack.chromium.mocha.ts"},"_npmUser":{"name":"wemeetagain","email":"caymannava@gmail.com"},"repository":{"url":"git+https://github.com/andywer/threads.js.git","type":"git"},"_npmVersion":"8.19.3","description":"Web workers & worker threads as simple as a function call","directories":{},"sideEffects":["./dist*/master/register.js","./dist*/worker/index.js","./register.*js","./worker.*js"],"_nodeVersion":"18.13.0","dependencies":{"debug":"^4.2.0","callsites":"^3.1.0","tiny-worker":">= 2","is-observable":"^2.1.0","observable-fns":"^0.6.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","chai":"^4.2.0","wavy":"^1.0.4","execa":"^4.0.3","mocha":"^8.2.0","rimraf":"^3.0.2","rollup":"^2.32.1","tslint":"^6.1.3","ts-node":"^9.0.0","webpack":"^4.44.2","cross-env":"^7.0.2","ts-loader":"^8.0.7","puppet-run":"^0.11.3","raw-loader":"^4.0.2","typescript":"^4.2.3","@types/chai":"^4.2.14","@types/node":"^14.14.5","tiny-worker":"^2.2.0","@types/debug":"^4.1.5","@types/execa":"^2.0.0","@types/mocha":"^8.0.3","worker-plugin":"^5.0.0","@types/webpack":"^4.41.23","threads-plugin":"^1.3.3","tslint-config-prettier":"^1.18.0","@rollup/plugin-commonjs":"^16.0.0","puppet-run-plugin-mocha":"^0.10.0-alpha","@rollup/plugin-node-resolve":"^10.0.0"},"optionalDependencies":{"tiny-worker":">= 2"},"_npmOperationalInternal":{"tmp":"tmp/threads_1.11.1_1689347127051_0.5127450560039812","host":"s3://npm-registry-packages"}},"1.11.2":{"name":"@chainsafe/threads","version":"1.11.2","keywords":["thread","worker","pool","spawn","isomorphic","parallel","observable","worker_threads"],"author":{"url":"https://github.com/andywer","name":"Andy Wermke"},"license":"MIT","_id":"@chainsafe/threads@1.11.2","maintainers":[{"name":"wemeetagain","email":"caymannava@gmail.com"},{"name":"mpetrunic","email":"marin.petrunic@gmail.com"}],"homepage":"https://threads.js.org","bugs":{"url":"https://github.com/andywer/threads.js/issues"},"ava":{"files":["./test/**/*.test.ts","./test-tooling/**/*.test.ts"],"serial":true,"require":["ts-node/register"],"extensions":["ts"]},"dist":{"shasum":"fc400efdfec2d246e5054e3521a9066dc2dc45af","tarball":"https://registry.npmjs.org/@chainsafe/threads/-/threads-1.11.2.tgz","fileCount":104,"integrity":"sha512-qd5mSYWyIgK+G4LQTLhJhO4IUda4eydYhZsT6AadALFUKs5WrHaFtAf7sLol6JjgWG7wwgznUs7FFyBl0xPmoQ==","signatures":[{"sig":"MEQCIDKlqPvzTuSqnaZkJOjjn7+BYvEhsJdnOAH3M2zOzDn4AiBKkmEsmpgdIhjK7S39UszeDRu4yBN7NsgfJfkFXNLdyw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":177845},"main":"dist/index.js","types":"./dist/index.d.ts","module":"dist-esm/index.js","browser":{"ts-node":false,"callsites":false,"tiny-worker":false,"worker_threads":false,"ts-node/register":false,"./dist/master/implementation.js":"./dist/master/implementation.browser.js","./dist/worker/implementation.js":"./dist/worker/implementation.browser.js","./dist-esm/master/implementation.js":"./dist-esm/master/implementation.browser.js","./dist-esm/worker/implementation.js":"./dist-esm/worker/implementation.browser.js","./dist/master/implementation.node.js":false,"./dist-esm/master/implementation.node.js":false,"./dist/worker/implementation.tiny-worker.js":false,"./dist/worker/implementation.worker_threads.js":false,"./dist-esm/worker/implementation.tiny-worker.js":false,"./dist-esm/worker/implementation.worker_threads.js":false},"exports":{".":{"default":"./index.mjs","require":"./dist/index.js"},"./worker":{"default":"./worker.mjs","require":"./worker.js"},"./register":{"default":"./register.mjs","require":"./register.js"},"./observable":{"default":"./observable.mjs","require":"./observable.js"}},"funding":"https://github.com/andywer/threads.js?sponsor=1","gitHead":"d54ba7134ccd5995dcc88cb4f95b0c35e2a04d5b","scripts":{"dev":"npm run clean && tsc -p tsconfig.json --watch","test":"npm run test:library && npm run test:tooling && npm run test:puppeteer:basic && npm run test:puppeteer:webpack","build":"npm run clean && npm run build:cjs && npm run build:es","clean":"rimraf dist/ dist-esm/","bundle":"rollup -c -f umd --file=bundle/worker.js --name=threads --silent -- dist-esm/worker/bundle-entry.js","prepare":"npm run build","build:es":"tsc -p tsconfig-esm.json","posttest":"tslint --project .","build:cjs":"tsc -p tsconfig.json","postbuild":"npm run bundle","test:library":"cross-env TS_NODE_FILES=true ava ./test/**/*.test.ts","test:tooling":"cross-env TS_NODE_FILES=true ava ./test-tooling/**/*.test.ts","test:puppeteer:basic":"puppet-run --plugin=mocha --bundle=./test/workers/:workers/ --serve=./bundle/worker.js:/worker.js ./test/*.chromium*.ts","test:puppeteer:webpack":"puppet-run --serve ./test-tooling/webpack/dist/app.web/0.worker.js --serve ./test-tooling/webpack/dist/app.web/1.worker.js --plugin=mocha ./test-tooling/webpack/webpack.chromium.mocha.ts"},"_npmUser":{"name":"wemeetagain","email":"caymannava@gmail.com"},"repository":{"url":"git+https://github.com/andywer/threads.js.git","type":"git"},"_npmVersion":"10.9.2","description":"Web workers & worker threads as simple as a function call","directories":{},"sideEffects":["./dist*/master/register.js","./dist*/worker/index.js","./register.*js","./worker.*js"],"_nodeVersion":"22.13.1","dependencies":{"debug":"^4.2.0","callsites":"^3.1.0","is-observable":"^2.1.0","observable-fns":"^0.6.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","chai":"^4.2.0","wavy":"^1.0.4","execa":"^4.0.3","mocha":"^8.2.0","rimraf":"^3.0.2","rollup":"^2.32.1","tslint":"^6.1.3","ts-node":"^9.0.0","webpack":"^4.44.2","cross-env":"^7.0.2","ts-loader":"^8.0.7","puppet-run":"^0.11.3","raw-loader":"^4.0.2","typescript":"^4.2.3","@types/chai":"^4.2.14","@types/node":"^14.14.5","tiny-worker":"^2.2.0","@types/debug":"^4.1.5","@types/execa":"^2.0.0","@types/mocha":"^8.0.3","worker-plugin":"^5.0.0","@types/webpack":"^4.41.23","threads-plugin":"^1.3.3","tslint-config-prettier":"^1.18.0","@rollup/plugin-commonjs":"^16.0.0","puppet-run-plugin-mocha":"^0.10.0-alpha","@rollup/plugin-node-resolve":"^10.0.0"},"optionalDependencies":{"tiny-worker":">= 2"},"_npmOperationalInternal":{"tmp":"tmp/threads_1.11.2_1748273142886_0.9642155974765296","host":"s3://npm-registry-packages-npm-production"}},"1.11.3":{"name":"@chainsafe/threads","version":"1.11.3","keywords":["thread","worker","pool","spawn","isomorphic","parallel","observable","worker_threads"],"author":{"url":"https://github.com/andywer","name":"Andy Wermke"},"license":"MIT","_id":"@chainsafe/threads@1.11.3","maintainers":[{"name":"wemeetagain","email":"caymannava@gmail.com"}],"homepage":"https://threads.js.org","bugs":{"url":"https://github.com/andywer/threads.js/issues"},"ava":{"files":["./test/**/*.test.ts","./test-tooling/**/*.test.ts"],"serial":true,"require":["ts-node/register"],"extensions":["ts"]},"dist":{"shasum":"7dba606277bfb0e9c8a54325da0372494ec02042","tarball":"https://registry.npmjs.org/@chainsafe/threads/-/threads-1.11.3.tgz","fileCount":104,"integrity":"sha512-wTIHTOOJ3MMRFtnJJT6KJCuauyv8pgs79m5ipspyPjHdKM9HJnkeZcoo06G3qArx2xMvd6MqNj1TLfnh5iFvaQ==","signatures":[{"sig":"MEUCIQC0ONFKp4v0krYkJca1E4BYkKAqW0sAvU1K9JX4dAzbxAIgSTvCAcH4awTie46jEtAl/n87QjqOGlBgt2I4M4jBzbg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":177989},"main":"dist/index.js","types":"./dist/index.d.ts","module":"dist-esm/index.js","browser":{"ts-node":false,"callsites":false,"tiny-worker":false,"worker_threads":false,"ts-node/register":false,"./dist/master/implementation.js":"./dist/master/implementation.browser.js","./dist/worker/implementation.js":"./dist/worker/implementation.browser.js","./dist-esm/master/implementation.js":"./dist-esm/master/implementation.browser.js","./dist-esm/worker/implementation.js":"./dist-esm/worker/implementation.browser.js","./dist/master/implementation.node.js":false,"./dist-esm/master/implementation.node.js":false,"./dist/worker/implementation.tiny-worker.js":false,"./dist/worker/implementation.worker_threads.js":false,"./dist-esm/worker/implementation.tiny-worker.js":false,"./dist-esm/worker/implementation.worker_threads.js":false},"exports":{".":{"types":"./dist/index.d.ts","default":"./index.mjs","require":"./dist/index.js"},"./worker":{"types":"./worker.d.ts","default":"./worker.mjs","require":"./worker.js"},"./register":{"types":"./register.d.ts","default":"./register.mjs","require":"./register.js"},"./observable":{"types":"./observable.d.ts","default":"./observable.mjs","require":"./observable.js"}},"funding":"https://github.com/andywer/threads.js?sponsor=1","gitHead":"e8da34b0a477ec5bcdd72a4f17e9a4c78e245c67","scripts":{"dev":"npm run clean && tsc -p tsconfig.json --watch","test":"npm run test:library && npm run test:tooling && npm run test:puppeteer:basic && npm run test:puppeteer:webpack","build":"npm run clean && npm run build:cjs && npm run build:es","clean":"rimraf dist/ dist-esm/","bundle":"rollup -c -f umd --file=bundle/worker.js --name=threads --silent -- dist-esm/worker/bundle-entry.js","prepare":"npm run build","build:es":"tsc -p tsconfig-esm.json","posttest":"tslint --project .","build:cjs":"tsc -p tsconfig.json","postbuild":"npm run bundle","test:library":"cross-env TS_NODE_FILES=true ava ./test/**/*.test.ts","test:tooling":"cross-env TS_NODE_FILES=true ava ./test-tooling/**/*.test.ts","test:puppeteer:basic":"puppet-run --plugin=mocha --bundle=./test/workers/:workers/ --serve=./bundle/worker.js:/worker.js ./test/*.chromium*.ts","test:puppeteer:webpack":"puppet-run --serve ./test-tooling/webpack/dist/app.web/0.worker.js --serve ./test-tooling/webpack/dist/app.web/1.worker.js --plugin=mocha ./test-tooling/webpack/webpack.chromium.mocha.ts"},"_npmUser":{"name":"wemeetagain","email":"caymannava@gmail.com"},"repository":{"url":"git+https://github.com/andywer/threads.js.git","type":"git"},"_npmVersion":"10.9.3","description":"Web workers & worker threads as simple as a function call","directories":{},"sideEffects":["./dist*/master/register.js","./dist*/worker/index.js","./register.*js","./worker.*js"],"_nodeVersion":"22.18.0","dependencies":{"debug":"^4.2.0","callsites":"^3.1.0","is-observable":"^2.1.0","observable-fns":"^0.6.1"},"_hasShrinkwrap":false,"devDependencies":{"ava":"^3.13.0","chai":"^4.2.0","wavy":"^1.0.4","execa":"^4.0.3","mocha":"^8.2.0","rimraf":"^3.0.2","rollup":"^2.32.1","tslint":"^6.1.3","ts-node":"^9.0.0","webpack":"^4.44.2","cross-env":"^7.0.2","ts-loader":"^8.0.7","puppet-run":"^0.11.3","raw-loader":"^4.0.2","typescript":"^4.2.3","@types/chai":"^4.2.14","@types/node":"^14.14.5","tiny-worker":"^2.2.0","@types/debug":"^4.1.5","@types/execa":"^2.0.0","@types/mocha":"^8.0.3","worker-plugin":"^5.0.0","@types/webpack":"^4.41.23","threads-plugin":"^1.3.3","tslint-config-prettier":"^1.18.0","@rollup/plugin-commonjs":"^16.0.0","puppet-run-plugin-mocha":"^0.10.0-alpha","@rollup/plugin-node-resolve":"^10.0.0"},"optionalDependencies":{"tiny-worker":">= 2"},"_npmOperationalInternal":{"tmp":"tmp/threads_1.11.3_1757684514608_0.5906426950051811","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2022-04-11T19:09:32.495Z","modified":"2026-04-21T09:51:41.912Z","1.8.0":"2022-04-11T19:09:32.794Z","1.9.0":"2022-04-11T20:01:15.251Z","1.10.0":"2022-05-12T13:23:14.362Z","1.11.0":"2023-05-24T14:54:19.591Z","1.11.1":"2023-07-14T15:05:27.252Z","1.11.2":"2025-05-26T15:25:43.074Z","1.11.3":"2025-09-12T13:41:54.800Z"},"bugs":{"url":"https://github.com/andywer/threads.js/issues"},"author":{"url":"https://github.com/andywer","name":"Andy Wermke"},"license":"MIT","homepage":"https://threads.js.org","keywords":["thread","worker","pool","spawn","isomorphic","parallel","observable","worker_threads"],"repository":{"url":"git+https://github.com/andywer/threads.js.git","type":"git"},"description":"Web workers & worker threads as simple as a function call","maintainers":[{"email":"caymannava@gmail.com","name":"wemeetagain"},{"email":"me@matthewkeil.com","name":"matthewkeil"}],"readme":"<h1 align=\"center\">\n  <img alt=\"threads.js\" src=\"./docs/assets/logo-label.png\" width=\"75%\" />\n</h1>\n<p align=\"center\">\n  <a href=\"https://travis-ci.org/andywer/threads.js\" target=\"_blank\"><img alt=\"Build status\" src=\"https://img.shields.io/travis/andywer/threads.js/v1.svg?style=flat-square\"></a>\n  <a href=\"https://www.npmjs.com/package/threads\" target=\"_blank\"><img alt=\"npm (tag)\" src=\"https://img.shields.io/npm/v/threads.svg?style=flat-square\"></a>\n  <a href=\"https://gitter.im/threadsjs/community\" target=\"_blank\"><img alt=\"Chat room\" src=\"https://img.shields.io/badge/chat-gitter.im-orange\" /></a>\n</p>\n\n<br />\n\nOffload CPU-intensive tasks to worker threads in node.js, web browsers and electron using one uniform API.\n\nUses web workers in the browser, `worker_threads` in node 12+ and [`tiny-worker`](https://github.com/avoidwork/tiny-worker) in node 8 to 11.\n\n### Features\n\n* First-class support for **async functions** & **observables**\n* Write code once, run it **on all platforms**\n* Manage bulk task executions with **thread pools**\n* Use **require()** and **import**/**export** in workers\n* Works great with **webpack**\n\n### Version 0.x\n\nYou can find the old version 0.12 of threads.js on the [`v0` branch](https://github.com/andywer/threads.js/tree/v0). All the content on this page refers to version 1.0 which is a rewrite of the library with a whole new API.\n\n## Installation\n\n```\nnpm install threads tiny-worker\n```\n\n*You only need to install the `tiny-worker` package to support node.js < 12. It's an optional dependency and used as a fallback if `worker_threads` are not available.*\n\n## Platform support\n\n<details>\n<summary>Run on node.js</summary>\n\n<p></p>\n\nRunning code using threads.js in node works out of the box.\n\nNote that we wrap the native `Worker`, so `new Worker(\"./foo/bar\")` will resolve the path relative to the module that calls it, not relative to the current working directory.\n\nThat aligns it with the behavior when bundling the code with webpack or parcel.\n\n</details>\n\n<details>\n<summary>Webpack build setup</summary>\n\n#### Webpack config\n\nUse with the [`threads-plugin`](https://github.com/andywer/threads-plugin). It will transparently detect all `new Worker(\"./unbundled-path\")` expressions, bundles the worker code and replaces the `new Worker(...)` path with the worker bundle path, so you don't need to explicitly use the `worker-loader` or define extra entry points.\n\n```sh\n  npm install -D threads-plugin\n```\n\nThen add it to your `webpack.config.js`:\n\n```diff\n+ const ThreadsPlugin = require('threads-plugin');\n\n  module.exports = {\n    // ...\n    plugins: [\n+     new ThreadsPlugin()\n    ]\n    // ...\n  }\n```\n\n#### Node.js bundles\n\nIf you are using webpack to create a bundle that will be run in node (webpack config `target: \"node\"`), you also need to specify that the `tiny-worker` package used for node < 12 should not be bundled:\n\n```diff\n  module.exports = {\n    // ...\n+   externals: {\n+     \"tiny-worker\": \"tiny-worker\"\n+   }\n    // ...\n}\n```\n\nMake sure that `tiny-worker` is listed in your `package.json` `dependencies` in that case.\n\n#### When using TypeScript\n\nNote: You'll need to be using Typescript version 4+, as the types generated by threads.js are not supported in Typescript 3.\n\nMake sure the TypeScript compiler keeps the `import` / `export` statements intact, so webpack resolves them. Otherwise the `threads-plugin` won't be able to do its job.\n\n```diff\n  module.exports = {\n    // ...\n    module: {\n      rules: [\n        {\n          test: /\\.ts$/,\n          loader: \"ts-loader\",\n+         options: {\n+           compilerOptions: {\n+             module: \"esnext\"\n+           }\n+         }\n        }\n      ]\n    },\n    // ...\n  }\n```\n\n</details>\n\n<details>\n<summary>Parcel bundler setup</summary>\n\n<p></p>\n\nYou need to import `threads/register` once at the beginning of your application code (in the master code, not in the workers):\n\n```diff\n  import { spawn } from \"threads\"\n+ import \"threads/register\"\n\n  // ...\n\n  const work = await spawn(new Worker(\"./worker\"))\n```\n\nThis registers the library's `Worker` implementation for your platform as the global `Worker`. This is necessary, since you cannot `import { Worker } from \"threads\"` or Parcel won't recognize `new Worker()` as a web worker anymore.\n\nBe aware that this might affect any code that tries to instantiate a normal web worker `Worker` and now instead instantiates a threads.js `Worker`. The threads.js `Worker` is just a web worker with some sugar on top, but that sugar might have unexpected side effects on third-party libraries.\n\nEverything else should work out of the box.\n\n</details>\n\n## Getting Started\n\n### Basics\n\n```js\n// master.js\nimport { spawn, Thread, Worker } from \"threads\"\n\nconst auth = await spawn(new Worker(\"./workers/auth\"))\nconst hashed = await auth.hashPassword(\"Super secret password\", \"1234\")\n\nconsole.log(\"Hashed password:\", hashed)\n\nawait Thread.terminate(auth)\n```\n\n```js\n// workers/auth.js\nimport sha256 from \"js-sha256\"\nimport { expose } from \"threads/worker\"\n\nexpose({\n  hashPassword(password, salt) {\n    return sha256(password + salt)\n  }\n})\n```\n\n### spawn()\n\nThe `hashPassword()` function of the `auth` object in the master code proxies the call to the `hashPassword()` function in the worker:\n\nIf the worker's function returns a promise or an observable then you can just use the return value as such in the master code. If the function returns a primitive value, expect the master function to return a promise resolving to that value.\n\n### expose()\n\nUse `expose()` to make a function or an object containing methods callable from the master thread.\n\nIn case of exposing an object, `spawn()` will asynchronously return an object exposing all the object's functions. If you `expose()` a function, `spawn` will also return a callable function, not an object.\n\n## Usage\n\n<p>\n  Find the full documentation on the <a href=\"https://threads.js.org/\" rel=\"nofollow\">website</a>:\n</p>\n\n- [**Quick start**](https://threads.js.org/getting-started)\n- [**Basic usage**](https://threads.js.org/usage)\n- [**Using observables**](https://threads.js.org/usage-observables)\n- [**Thread pools**](https://threads.js.org/usage-pool)\n- [**Advanced**](https://threads.js.org/usage-advanced)\n\n## Webpack\n\nThreads.js works with webpack. Usually all you need to do is adding the\n[`threads-plugin`](https://github.com/andywer/threads-plugin).\n\nSee [Build with webpack](https://threads.js.org/getting-started#build-with-webpack)\non the website for details.\n\n<!--\n## API\n\nTODO\n-->\n\n## Debug\n\nWe are using the [`debug`](https://github.com/visionmedia/debug) package to provide opt-in debug logging. All the package's debug messages have a scope starting with `threads:`, with different sub-scopes:\n\n- `threads:master:messages`\n- `threads:master:spawn`\n- `threads:master:thread-utils`\n- `threads:pool:${poolName || poolID}`\n\nSet it to `DEBUG=threads:*` to enable all the library's debug logging. To run its tests with full debug logging, for instance:\n\n```\nDEBUG=threads:* npm test\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}