{"_id":"async-hook-domain","_rev":"4062993","name":"async-hook-domain","description":"An implementation of Domain-like error handling, built on async_hooks","dist-tags":{"latest":"4.0.1"},"maintainers":[{"name":"isaacs","email":""}],"time":{"modified":"2025-09-24T04:25:33.000Z","created":"2019-03-20T07:08:08.009Z","4.0.1":"2023-05-21T06:13:55.259Z","4.0.0":"2023-05-21T05:29:54.385Z","3.0.2":"2022-11-15T05:35:37.503Z","3.0.1":"2022-11-15T05:28:27.028Z","3.0.0":"2022-11-15T05:27:02.884Z","2.0.4":"2021-09-15T22:58:08.924Z","2.0.3":"2021-04-13T22:13:23.873Z","2.0.2":"2021-02-16T19:02:25.674Z","2.0.1":"2019-12-13T06:40:47.585Z","1.1.3":"2019-10-16T00:50:46.299Z","1.1.2":"2019-10-16T00:49:48.644Z","1.1.1":"2019-09-29T19:43:42.882Z","1.1.0":"2019-03-20T23:16:18.297Z","1.0.1":"2019-03-20T14:19:43.327Z","1.0.0":"2019-03-20T07:08:08.009Z"},"users":{},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"versions":{"4.0.1":{"name":"async-hook-domain","version":"4.0.1","description":"An implementation of Domain-like error handling, built on async_hooks","main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","module":"./dist/mjs/index.js","exports":{"./package.json":{"import":"./package.json","require":"./package.json"},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"scripts":{"preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap test/fixtures","snap":"c8 tap test/fixtures","format":"prettier --write . --loglevel warn","typedoc":"typedoc --tsconfig tsconfig-esm.json ./lib/*.*ts","start":"node server.js"},"devDependencies":{"@npmcli/promise-spawn":"^2.0.1","@types/node":"^20.2.1","@types/npmcli__promise-spawn":"^6.0.0","@types/tap":"^15.0.8","@types/uuid":"^9.0.1","c8":"^7.13.0","diff":"^5.0.0","prettier":"^2.6.2","tap":"^16.3.0","ts-node":"^10.9.1","typescript":"^5.0.4"},"prettier":{"semi":false,"printWidth":80,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--enable-source-maps","--no-warnings","--loader","ts-node/esm","test/run.js"],"ts":false},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","engines":{"node":">=16"},"gitHead":"b9ba43fd340b5003d3eaee6e22ed0cfb8d755130","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"homepage":"https://github.com/tapjs/async-hook-domain#readme","_id":"async-hook-domain@4.0.1","_nodeVersion":"18.16.0","_npmVersion":"9.6.5","dist":{"shasum":"e2e359e387dd021a7e16f77a5be8506ebe0ed729","size":10733,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-4.0.1.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_4.0.1_1684649635093_0.8252518756604046"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-21T06:13:55.259Z","publish_time":1684649635259,"_source_registry_name":"default","_cnpm_publish_time":1684649635259},"4.0.0":{"name":"async-hook-domain","version":"4.0.0","description":"An implementation of Domain-like error handling, built on async_hooks","main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","module":"./dist/mjs/index.js","exports":{"./package.json":{"import":"./package.json","require":"./package.json"},".":{"import":{"types":"./dist/mjs/index.d.mts","default":"./dist/mjs/index.mjs"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}}},"scripts":{"preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap test/fixtures","snap":"c8 tap test/fixtures","format":"prettier --write . --loglevel warn","typedoc":"typedoc --tsconfig tsconfig-esm.json ./lib/*.*ts","start":"node server.js"},"devDependencies":{"@npmcli/promise-spawn":"^2.0.1","@types/node":"^20.2.1","@types/npmcli__promise-spawn":"^6.0.0","@types/tap":"^15.0.8","@types/uuid":"^9.0.1","c8":"^7.13.0","diff":"^5.0.0","prettier":"^2.6.2","tap":"^16.3.0","ts-node":"^10.9.1","typescript":"^5.0.4"},"prettier":{"semi":false,"printWidth":80,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--enable-source-maps","--no-warnings","--loader","ts-node/esm","test/run.js"],"ts":false},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","engines":{"node":">=16"},"gitHead":"2a7b75e6b1dbd9059b1590b45e434ea0b93bc50d","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"homepage":"https://github.com/tapjs/async-hook-domain#readme","_id":"async-hook-domain@4.0.0","_nodeVersion":"18.16.0","_npmVersion":"9.6.5","dist":{"shasum":"898490f2c83c42bc3d9534910cc220909d541bf9","size":10739,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-4.0.0.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_4.0.0_1684646994209_0.9642071246122208"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-21T05:29:54.385Z","publish_time":1684646994385,"_source_registry_name":"default","_cnpm_publish_time":1684646994385},"3.0.2":{"name":"async-hook-domain","version":"3.0.2","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","devDependencies":{"@types/node":"^18.11.9","eslint-config-prettier":"^8.5.0","prettier":"^2.7.1","source-map-support":"^0.5.21","tap":"^16.3.1"},"scripts":{"format":"prettier --write . --loglevel warn","test":"tap test/fixtures","snap":"tap test/fixtures","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","start":"node server.js"},"eslintIgnore":["/node_modules","/tap-snapshots"],"prettier":{"semi":false,"printWidth":80,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"node-arg":["test/run.js"],"check-coverage":true},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","engines":{"node":">=16"},"types":"./index.d.ts","gitHead":"275ce01b351ffe96afa087c468f0fd12c4e16eb0","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"homepage":"https://github.com/tapjs/async-hook-domain#readme","_id":"async-hook-domain@3.0.2","_nodeVersion":"18.12.0","_npmVersion":"9.1.1","dist":{"shasum":"3453678fbc62c90647f75ce7541aa8c188312ad2","size":6731,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-3.0.2.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_3.0.2_1668490537308_0.7719012247722825"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-15T05:35:41.534Z","publish_time":1668490537503,"_cnpm_publish_time":1668490537503},"3.0.1":{"name":"async-hook-domain","version":"3.0.1","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","devDependencies":{"@types/node":"^18.11.9","eslint-config-prettier":"^8.5.0","prettier":"^2.7.1","source-map-support":"^0.5.21","tap":"^16.3.1"},"scripts":{"format":"prettier --write . --loglevel warn","test":"tap test/fixtures","snap":"tap test/fixtures","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","start":"node server.js"},"eslintIgnore":["/node_modules","/tap-snapshots"],"prettier":{"semi":false,"printWidth":80,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"node-arg":["test/run.js"],"check-coverage":true},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","engines":{"node":">=16"},"types":"./index.d.ts","gitHead":"29443fbcfb40f25aa1b8028ada141760e02139b5","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"homepage":"https://github.com/tapjs/async-hook-domain#readme","_id":"async-hook-domain@3.0.1","_nodeVersion":"18.12.0","_npmVersion":"9.1.1","dist":{"shasum":"c9789bbfa4dcbc5e5d54b249dfd68cf375a37df6","size":6711,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-3.0.1.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_3.0.1_1668490106877_0.22518778066095213"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-15T05:28:30.982Z","publish_time":1668490107028,"_cnpm_publish_time":1668490107028},"3.0.0":{"name":"async-hook-domain","version":"3.0.0","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","devDependencies":{"@types/node":"^18.11.9","eslint-config-prettier":"^8.5.0","prettier":"^2.7.1","source-map-support":"^0.5.21","tap":"^16.3.1"},"scripts":{"format":"prettier --write . --loglevel warn","test":"tap test/fixtures","snap":"tap test/fixtures","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","start":"node server.js"},"eslintIgnore":["/node_modules","/tap-snapshots"],"prettier":{"semi":false,"printWidth":80,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"node-arg":["test/run.js"],"check-coverage":true},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","engines":{"node":">=16"},"types":"./index.d.ts","gitHead":"0950a329a066f7162e2508267047c407f2edc3df","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"homepage":"https://github.com/tapjs/async-hook-domain#readme","_id":"async-hook-domain@3.0.0","_nodeVersion":"18.12.0","_npmVersion":"9.1.1","dist":{"shasum":"59cf104f42e0937d2d6480db918a556caf992848","size":6576,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-3.0.0.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_3.0.0_1668490022760_0.986331536461694"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-15T05:27:12.785Z","publish_time":1668490022884,"_cnpm_publish_time":1668490022884},"2.0.4":{"name":"async-hook-domain","version":"2.0.4","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"devDependencies":{"source-map-support":"^0.5.16","tap":"^15.0.9"},"scripts":{"test":"tap test/fixtures","snap":"tap test/fixtures","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags"},"tap":{"node-arg":["test/run.js"],"check-coverage":true},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","engines":{"node":">=10"},"gitHead":"06b166ca2df2b719b92af25e75f61ee3a956b3a1","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"homepage":"https://github.com/tapjs/async-hook-domain#readme","_id":"async-hook-domain@2.0.4","_nodeVersion":"16.5.0","_npmVersion":"7.23.0","dist":{"shasum":"5a24910982c04394ea33dd442860f80cce2d972c","size":5401,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-2.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-2.0.4.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_2.0.4_1631746688803_0.7137976210319208"},"_hasShrinkwrap":false,"publish_time":1631746688924,"_cnpm_publish_time":1631746688924},"2.0.3":{"name":"async-hook-domain","version":"2.0.3","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"devDependencies":{"source-map-support":"^0.5.16","tap":"^14.10.2"},"scripts":{"test":"tap test/fixtures","snap":"tap test/fixtures","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags"},"tap":{"node-arg":["test/run.js"],"check-coverage":true},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","engines":{"node":">=10"},"gitHead":"4739ee08e08efd06401c7c0e5193ed90341786df","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"homepage":"https://github.com/tapjs/async-hook-domain#readme","_id":"async-hook-domain@2.0.3","_nodeVersion":"15.3.0","_npmVersion":"7.9.0","dist":{"shasum":"702d86fc21866bcb0f38b32214d04c2e5a311429","size":5356,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-2.0.3.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_2.0.3_1618352003732_0.7365018611866481"},"_hasShrinkwrap":false,"publish_time":1618352003873,"_cnpm_publish_time":1618352003873},"2.0.2":{"name":"async-hook-domain","version":"2.0.2","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"devDependencies":{"source-map-support":"^0.5.16","tap":"^14.10.2"},"scripts":{"test":"tap test/fixtures","snap":"tap test/fixtures","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags"},"tap":{"node-arg":["test/run.js"],"check-coverage":true},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","engines":{"node":">=10"},"gitHead":"8e8b1fafe29fb24249bea6e3f798eb77a3f696e2","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"homepage":"https://github.com/tapjs/async-hook-domain#readme","_id":"async-hook-domain@2.0.2","_nodeVersion":"15.3.0","_npmVersion":"7.5.4","dist":{"shasum":"ce9444b106bb113a4d48bf1c29762cce51a64a6b","size":5288,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-2.0.2.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_2.0.2_1613502145362_0.5151584467797159"},"_hasShrinkwrap":false,"publish_time":1613502145674,"_cnpm_publish_time":1613502145674},"2.0.1":{"name":"async-hook-domain","version":"2.0.1","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"devDependencies":{"source-map-support":"^0.5.16","tap":"^14.10.2"},"scripts":{"test":"tap --node-arg=test/run.js test/fixtures","snap":"tap --node-arg=test/run.js test/fixtures","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"repository":{"type":"git","url":"git://github.com/tapjs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","engines":{"node":">=10"},"gitHead":"010db04cfc9185a81f95d63a1e947dd82e7c4877","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"homepage":"https://github.com/tapjs/async-hook-domain#readme","_id":"async-hook-domain@2.0.1","_nodeVersion":"13.3.0","_npmVersion":"6.13.4","dist":{"shasum":"92eb9fbb9988caa956fdc7947e6659078ff3c232","size":5288,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-2.0.1.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_2.0.1_1576219247462_0.6652233696904759"},"_hasShrinkwrap":false,"publish_time":1576219247585,"_cnpm_publish_time":1576219247585},"1.1.3":{"name":"async-hook-domain","version":"1.1.3","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"dependencies":{"source-map-support":"^0.5.11"},"devDependencies":{"tap":"^14.6.6"},"scripts":{"test":"tap --node-arg=test/run.js test/fixtures","snap":"tap --node-arg=test/run.js test/fixtures","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"repository":{"type":"git","url":"git://github.com/isaacs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","gitHead":"8bd131194b675be4d49c8a7d15475097ba9adeef","bugs":{"url":"https://github.com/isaacs/async-hook-domain/issues"},"homepage":"https://github.com/isaacs/async-hook-domain#readme","_id":"async-hook-domain@1.1.3","_nodeVersion":"12.12.0","_npmVersion":"6.12.0","dist":{"shasum":"f4f531b8ee8206b1ea1825fe3825e015c66f44d0","size":5296,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-1.1.3.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_1.1.3_1571187046176_0.234358338138414"},"_hasShrinkwrap":false,"publish_time":1571187046299,"_cnpm_publish_time":1571187046299},"1.1.2":{"name":"async-hook-domain","version":"1.1.2","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"dependencies":{"source-map-support":"^0.5.11"},"devDependencies":{"tap":"^14.6.6"},"scripts":{"test":"tap --node-arg=test/run.js test/fixtures","snap":"tap --node-arg=test/run.js test/fixtures","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"repository":{"type":"git","url":"git://github.com/isaacs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","gitHead":"3fd75a1c94718363907a6a7cd59f1d6f6820832a","bugs":{"url":"https://github.com/isaacs/async-hook-domain/issues"},"homepage":"https://github.com/isaacs/async-hook-domain#readme","_id":"async-hook-domain@1.1.2","_nodeVersion":"12.12.0","_npmVersion":"6.12.0","dist":{"shasum":"2c5545c24f076ba7e3af26a6bcb3357515497667","size":5287,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-1.1.2.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_1.1.2_1571186988520_0.3029677832938493"},"_hasShrinkwrap":false,"publish_time":1571186988644,"_cnpm_publish_time":1571186988644},"1.1.1":{"name":"async-hook-domain","version":"1.1.1","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"dependencies":{"source-map-support":"^0.5.11"},"devDependencies":{"tap":"^14.6.6"},"scripts":{"test":"tap --node-arg=test/run.js test/fixtures","snap":"tap --node-arg=test/run.js test/fixtures","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"repository":{"type":"git","url":"git://github.com/isaacs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","gitHead":"36f779b8c7ccbc9ddbc8e7d376e1081c29a178e8","bugs":{"url":"https://github.com/isaacs/async-hook-domain/issues"},"homepage":"https://github.com/isaacs/async-hook-domain#readme","_id":"async-hook-domain@1.1.1","_nodeVersion":"12.8.1","_npmVersion":"6.12.0-next.0","dist":{"shasum":"e8f56d037c624339cc03b9fb875cc444a0350b7d","size":5281,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-1.1.1.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_1.1.1_1569786222768_0.8479946386706882"},"_hasShrinkwrap":false,"publish_time":1569786222882,"_cnpm_publish_time":1569786222882},"1.1.0":{"name":"async-hook-domain","version":"1.1.0","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"dependencies":{"source-map-support":"^0.5.11"},"devDependencies":{"tap":"^13.0.0-rc.11"},"scripts":{"test":"tap test/run.js","snap":"tap test/run.js","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --all; git push origin --tags"},"tap":{"check-coverage":true},"repository":{"type":"git","url":"git://github.com/isaacs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","gitHead":"e39e884e2b28f5dcdb1e9b7a65bfaf0f8e8ed901","bugs":{"url":"https://github.com/isaacs/async-hook-domain/issues"},"homepage":"https://github.com/isaacs/async-hook-domain#readme","_id":"async-hook-domain@1.1.0","_nodeVersion":"11.11.0","_npmVersion":"6.7.0","dist":{"shasum":"76855e572425c2bd1f7171f989bd40d70f12f9d6","size":4399,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-1.1.0.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_1.1.0_1553123778145_0.0725395500027961"},"_hasShrinkwrap":false,"publish_time":1553123778297,"_cnpm_publish_time":1553123778297},"1.0.1":{"name":"async-hook-domain","version":"1.0.1","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"dependencies":{"source-map-support":"^0.5.11"},"devDependencies":{"tap":"^13.0.0-rc.11"},"scripts":{"test":"tap test/run.js","snap":"tap test/run.js","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --all; git push origin --tags"},"tap":{"check-coverage":true},"repository":{"type":"git","url":"git://github.com/isaacs/async-hook-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","gitHead":"22f9d645db42149ed37718176dfba95fd94164c3","bugs":{"url":"https://github.com/isaacs/async-hook-domain/issues"},"homepage":"https://github.com/isaacs/async-hook-domain#readme","_id":"async-hook-domain@1.0.1","_nodeVersion":"11.11.0","_npmVersion":"6.7.0","dist":{"shasum":"e6f3bf211f7c6ffe72050e65f1e7222985478791","size":3888,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-1.0.1.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_1.0.1_1553091583108_0.3872279178586491"},"_hasShrinkwrap":false,"publish_time":1553091583327,"_cnpm_publish_time":1553091583327},"1.0.0":{"name":"async-hook-domain","version":"1.0.0","description":"An implementation of Domain-like error handling, built on async_hooks","main":"index.js","directories":{"test":"test"},"dependencies":{"source-map-support":"^0.5.11"},"devDependencies":{"tap":"^13.0.0-rc.11"},"scripts":{"test":"tap test/run.js","snap":"tap test/run.js","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --all; git push origin --tags"},"tap":{"check-coverage":true},"repository":{"type":"git","url":"git://github.com/isaacs/async-hooks-domain.git"},"keywords":["async","hooks","async_hooks","domain","error","handling","handler","uncaughtException","unhandledRejection","catch","promise","execution","context"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://blog.izs.me"},"license":"ISC","gitHead":"720eb859ddde9e524af2daf164f9e8cc610fadda","bugs":{"url":"https://github.com/isaacs/async-hooks-domain/issues"},"homepage":"https://github.com/isaacs/async-hooks-domain#readme","_id":"async-hook-domain@1.0.0","_nodeVersion":"11.11.0","_npmVersion":"6.7.0","dist":{"shasum":"fde4838208e1c75970ab14d4fa5854551f7865a5","size":3892,"noattachment":false,"key":"/async-hook-domain/-/async-hook-domain-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-domain/download/async-hook-domain-1.0.0.tgz"},"maintainers":[{"name":"isaacs","email":""}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-domain_1.0.0_1553065687877_0.07987284613504464"},"_hasShrinkwrap":false,"publish_time":1553065688009,"_cnpm_publish_time":1553065688009}},"readme":"# async-hook-domain\n\nAn implementation of the error-handling properties of the\ndeprecated `domain` node core module, re-implemented on top of\n[`async_hooks`](https://nodejs.org/api/async_hooks.html).\n\n## USAGE\n\n```js\n// hybrid module, either works\nimport { Domain } from 'async-hook-domain'\n// or: const { Domain } = require('async-hook-domain')\n\n// instantiating a Domain attaches it to the current async execution\n// context, and all child contexts that come off of it.  You don't have\n// to call d.enter() or d.run(cb), just instantiate and it's done.\n// Pass an error-handling function to the constructor.  This function\n// will be called whenever there is an uncaught exception or an\n// unhandled Promise rejection.\n\nconst d = new Domain(er => {\n  console.log('caught an error', er)\n  // if you re-throw, it's not going to be caught, and will probably\n  // cause the process to crash.\n})\n\nsetTimeout(() => {\n  throw new Error('this is caught by the domain a few lines up')\n})\n\nprocess.nextTick(() => {\n  const d2 = new Domain(er => {\n    console.log('any contexts spawned from this nextTick are caught here', er)\n    // only catch one error.  The next one will go to the parent\n    d2.destroy()\n  })\n  fs.readFile('does not exist', (er, data) => {\n    if (er) throw er\n  })\n  fs.readFile('also does not exist', (er, data) => {\n    if (er) throw er\n  })\n})\n\n// Adding a new domain here in the same context as the d above will\n// take over for this current context, as well as any that are created\n// from now on.  But it won't affect the setTimeout above, because that\n// async context was created before this domain existed.\nconst d3 = new Domain(er => console.log('d3', er))\n\n// Unhandled promise rejections are handled, too.\nPromise.reject(new Error('this will be handled by d3'))\n\n// since a Promise rejection is an async hop, if we destroyed it right\n// now, it would not be there to catch the Promise.reject event.\nsetTimeout(() => {\n  // destroying d3 makes it like it never happened, so this will\n  // be handled by the parent domain we created at the outset.\n  d3.destroy()\n  throw new Error('this will be handled by the parent')\n})\n\n// When all domains are destroyed either manually or by virtue of their\n// async execution contexts being completed, or if no domain is active\n// for the current execution context, then it reverts back to normal\n// operation, with all event handlers removed and everything cleaned up.\nsetTimeout(() => {\n  d.destroy()\n  throw new Error('this crashes the process like normal')\n}, 500) // time for the other contexts to wrap up\n```\n\nIf you want to limit a Domain to a narrower scope, you can use\nnode's\n[`AsyncResource`](https://nodejs.org/api/async_hooks.html#async_hooks_class_asyncresource)\nclass, and instantiate the domain within its\n`runInAsyncScope(cb)` method. From then on, the domain will only\nbe active when running from that Async Resource's scope.\n\n## Important `new Promise()` Construction Method Caveat\n\nIf you create a domain within a `Promise` construction method,\nthen rejections of that promise will only be handled by the\ndomain that was active when the Promise constructor was\ninstantiated, and _not_ the new domain you create within the\nconstructor.\n\nThis is because, even though the _rejection_ happens later, and\nany throws are deferred until that time, the Promise construction\nmethod _itself_ is run synchronously. So, the\n`executionAsyncId()` in that context is still the same as it was\nwhen the Promise constructor was initiated.\n\nFor example:\n\n```js\nimport { Domain } from 'async-hook-domain'\n\nconst d1 = new Domain(() => console.log('handled by d1'))\nnew Promise((_, reject) => { // <-- Promise bound to d1 domain\n\n  // executionAsyncId identical to outside the Promise constructor\n\n  // domains created later have no effect, Promise already bound,\n  // as it was created at the instant of calling new Promise()\n  // this is actually a new domain handling any subsequent throws\n  // in the *parent* context! confusing!\n  const d2 = new Domain(() => console.log('handled by d2'))\n\n  // timeout created in d2's context, *sibling* of eventual\n  // promise resolution/rejection\n  setTimeout(() => {\n    // d3 created as child of d2, but nothing bound to it\n    // would handle any new async behaviors triggered by\n    // the setTimeout's async context\n    const d3 = new Domain(() => console.log('handled by d3'))\n\n    // rejection occurs in child context, triggered by\n    // execution context where new Promise was initiated.\n    reject(new Error('will be handled by d1!'))\n  })\n})\n```\n\nSince Promise construction happens synchronously in the same\n`executionAsyncId()` contex as outside the function, domains\ncreated within that context are as if they were created outside\nof the Promise constructor, and will stack up for that context.\n\nFor example:\n\n```js\nimport { Domain } from 'async-hook-domain'\n\n// executionAsyncId=1, domain added\nconst d1 = new Domain(() => console.log('handled by d1'))\nnew Promise((_, reject) => {\n  // still executionAsyncId=1, new child domain takes over\n  // this is the new active domain for executionAsyncId=1,\n  // even outside the Promise constructor!\n  const d2 = new Domain(() => console.log('handled by d2'))\n  // setTimeout creates new executionAsyncId=3, bound to d2\n  setTimeout(() => {\n    // executionAsyncId=3, d3 handling any errors in it\n    const d3 = new Domain(() => console.log('handled by d3'))\n    // resolve happens in executionAsyncId=2, the promise\n    // resolution context triggered by the new Promise call\n    resolve('this is fine')\n  })\n})\n\n// throw happens in executionAsyncId=1, current domain is d2!\nthrow new Error('will be handled by d2!')\n```\n\nNote that since a throw within a `Promise` construction method is\ntreated as a call to `reject()`, this also applies to thrown\nerrors within the construction method:\n\n```js\nimport { Domain } from 'async-hook-domain'\nconst d1 = new Domain(() => console.error('handled by d1'))\nnew Promise((_, reject) => {\n  const d2 = new Domain(() => console.error('handled by d2'))\n\n  throw 'this will be handled by d1, not d2!'\n})\n```\n\nThe execution context of the Promise itself is bound to the\ndomain that was active at the time the Promise constructor\n_started_, so any rejection will be handled by that domain.\n\nIf this all sounds confusing and very deep in the weeds, a safe\napproach is to never create a new `Domain` within a Promise\nconstruction function. Then everything will behave as you'd\nexpect.\n\nI have explored the space here thoroughly, because this strikes\nme as counter-intuitive. As a user, I'd expect that a new domain\ncreated in a Promise constructor method would be a child of the\ndomain that binds _to the Promise resolution_, and thus take over\nhandling the subsequent Promise rejection, rather than binding to\nthe context outside the Promise constructor.\n\nBut that isn't how it works, and as of version 19, Node.js and v8\ndo not provide adequate API surface to make it behave that way\nwithout making _other_ behavior less reliable. A future\nSemVer-major change will address this caveat when and if it\nbecomes possible to do so.\n\n## API\n\n### `process.env.ASYNC_HOOK_DOMAIN_DEBUG = '1'`\n\nSet the `ASYNC_HOOK_DOMAIN_DEBUG` environment variable to `'1'`\nto print a lot of debugging information to stderr.\n\n### const d = new Domain(errorHandlerFunction(error, type))\n\nCreate a new Domain and assign it to the current execution\ncontext and all child contexts that the current one triggers.\n\nThe handler function is called with two arguments. The first is\nthe error that was thrown or the rejection value of the rejected\nPromise. The second is either `'uncaughtException'` or\n`'unhandledRejection'`, depending on the type of event that\nraised the error.\n\nNote that even if the Domain prevents the process from failing\nentirely, Node.js _may_ still print a warning about unhandled\nrejections, depending on the `--unhandled-rejections` option.\n\n### d.parent Domain\n\nIf a Domain is already assigned to the current context on\ncreation, then the current Domain set as the new Domain's\n`parent`. On destruction, any of a Domain's still-active\nexecution contexts are assigned to its parent.\n\n### d.onerror Function\n\nThe `errorHandlerFunction` passed into the constructor. Called\nwhen an uncaughtException or unhandledRejection occurs in the\nscope of the Domain.\n\nIf this function throws, then the domain will be destroyed, and\nthe thrown error will be raised. If the domain doesn't have a\nparent, then this will likely crash the process entirely.\n\n### d.destroyed Boolean\n\nSet to `true` if the domain is destroyed.\n\n### d.ids Set\n\nA set of the `executionAsyncId` values corresponding to the\nexecution contexts for which this Domain handles errors.\n\n### d.destroy() Function\n\nCall to destroy the domain. This removes it from the system\nentirely, assigning any outstanding ids to its parent, if it has\none, or leaving them uncovered if not.\n\nThis is called implicitly when the domain's last covered\nexecution context is destroyed, since at that point, the domain\nis unreachable anyway.\n","_attachments":{},"homepage":"https://github.com/tapjs/async-hook-domain#readme","bugs":{"url":"https://github.com/tapjs/async-hook-domain/issues"},"license":"ISC"}