{"_id":"async-hook-jl","_rev":"372739","name":"async-hook-jl","description":"Inspect the life of handle objects in node","dist-tags":{"latest":"1.7.6"},"maintainers":[{"name":"jeff-lewis","email":"jlewis@streetconnect.com"}],"time":{"modified":"2021-07-27T02:43:31.000Z","created":"2017-06-24T03:41:49.732Z","1.7.6":"2017-07-26T01:04:04.680Z","1.7.5":"2017-06-24T04:17:24.017Z","1.7.2":"2017-06-24T03:41:49.732Z"},"users":{},"author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"repository":{"type":"git","url":"git://github.com/jeff-lewis/async-hook-jl.git"},"versions":{"1.7.6":{"name":"async-hook-jl","description":"Inspect the life of handle objects in node","version":"1.7.6","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"main":"./index.js","scripts":{"test":"node ./test/runner.js && eslint ."},"repository":{"type":"git","url":"git://github.com/jeff-lewis/async-hook-jl.git"},"keywords":["async","async hooks","inspect","async wrap"],"license":"MIT","dependencies":{"stack-chain":"^1.3.7"},"devDependencies":{"async":"1.5.x","cli-color":"1.1.x","eslint":"^3.4.0","endpoint":"0.4.x"},"engines":{"node":"^4.7 || >=6.9 || >=7.3"},"gitHead":"88630f0f507b848ba3d4e3d5ba8f46a05aad8879","bugs":{"url":"https://github.com/jeff-lewis/async-hook-jl/issues"},"homepage":"https://github.com/jeff-lewis/async-hook-jl#readme","_id":"async-hook-jl@1.7.6","_npmVersion":"5.3.0","_nodeVersion":"6.11.1","_npmUser":{"name":"jeff-lewis","email":"jlewis@streetconnect.com"},"dist":{"shasum":"4fd25c2f864dbaf279c610d73bf97b1b28595e68","size":20259,"noattachment":false,"key":"/async-hook-jl/-/async-hook-jl-1.7.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-jl/download/async-hook-jl-1.7.6.tgz"},"maintainers":[{"name":"jeff-lewis","email":"jlewis@streetconnect.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-jl-1.7.6.tgz_1501031043382_0.46497373981401324"},"directories":{},"publish_time":1501031044680,"_hasShrinkwrap":false,"_cnpm_publish_time":1501031044680},"1.7.5":{"name":"async-hook-jl","description":"Inspect the life of handle objects in node","version":"1.7.5","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"main":"./index.js","scripts":{"test":"node ./test/runner.js && eslint ."},"repository":{"type":"git","url":"git://github.com/jeff-lewis/async-hook-jl.git"},"keywords":["async","async hooks","inspect","async wrap"],"license":"MIT","dependencies":{"stack-chain":"^1.3.7"},"devDependencies":{"async":"1.5.x","cli-color":"1.1.x","eslint":"^3.4.0","endpoint":"0.4.x"},"engines":{"node":"^4.7 || >=6.9 || >=7.3"},"gitHead":"7a821a2809a6e2648e79c32ed3ed288a62513c22","bugs":{"url":"https://github.com/jeff-lewis/async-hook-jl/issues"},"homepage":"https://github.com/jeff-lewis/async-hook-jl#readme","_id":"async-hook-jl@1.7.5","_shasum":"ee2de03e9fda603044325d7445ad8c6f50fa2ade","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"jeff-lewis","email":"jlewis@streetconnect.com"},"dist":{"shasum":"ee2de03e9fda603044325d7445ad8c6f50fa2ade","size":20190,"noattachment":false,"key":"/async-hook-jl/-/async-hook-jl-1.7.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-jl/download/async-hook-jl-1.7.5.tgz"},"maintainers":[{"name":"jeff-lewis","email":"jlewis@streetconnect.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-jl-1.7.5.tgz_1498277842908_0.1321076436433941"},"directories":{},"publish_time":1498277844017,"_hasShrinkwrap":false,"_cnpm_publish_time":1498277844017},"1.7.2":{"name":"async-hook-jl","description":"Inspect the life of handle objects in node","version":"1.7.2","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"main":"./index.js","scripts":{"test":"node ./test/runner.js && eslint ."},"repository":{"type":"git","url":"git://github.com/jeff-lewis/async-hook-jl.git"},"keywords":["async","async hooks","inspect","async wrap"],"license":"MIT","dependencies":{"stack-chain":"^1.3.7"},"devDependencies":{"async":"1.5.x","cli-color":"1.1.x","eslint":"^3.4.0","endpoint":"0.4.x"},"engines":{"node":"^4.7 || ~6.9 || ~7.3"},"gitHead":"659e416003d293d7587882b5d46a898d3b6327da","bugs":{"url":"https://github.com/jeff-lewis/async-hook-jl/issues"},"homepage":"https://github.com/jeff-lewis/async-hook-jl#readme","_id":"async-hook-jl@1.7.2","_shasum":"0d661a9245347d495bb9da842d9a7d482d4b1491","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"jeff-lewis","email":"jlewis@streetconnect.com"},"dist":{"shasum":"0d661a9245347d495bb9da842d9a7d482d4b1491","size":20179,"noattachment":false,"key":"/async-hook-jl/-/async-hook-jl-1.7.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/async-hook-jl/download/async-hook-jl-1.7.2.tgz"},"maintainers":[{"name":"jeff-lewis","email":"jlewis@streetconnect.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/async-hook-jl-1.7.2.tgz_1498275707870_0.016474348260089755"},"directories":{},"publish_time":1498275709732,"_hasShrinkwrap":false,"_cnpm_publish_time":1498275709732}},"readme":"[![Build Status](https://travis-ci.org/Jeff-Lewis/async-hook-jl.svg?branch=master)](https://travis-ci.org/Jeff-Lewis/async-hook-jl)\n\n#async-hook-jl\n\n> Inspect the life of handle objects in node\n\n## Documentation\n\nThis is high level abstraction of the currently undocumented node API called\nAsyncWrap. It patches some issues, makes the API more uniform and allows multiply\nhooks to be created.\n\nI personally hope that most of this will make it into nodecore, but for now\nit exists as an userland module.\n\nFor the details of how AsyncWrap works and by extension how this module works,\nplease see the semi-official AsyncWrap documentation:\nhttps://github.com/nodejs/diagnostics/blob/master/tracing/AsyncWrap/README.md\n\n```javascript\nconst asyncHook = require('async-hook-jl');\n```\n\n#### Hooks\n\nThe function arguments are:\n\n```javascript\nfunction init(uid, handle, provider, parentUid, parentHandle) { /* your code */ }\nfunction pre(uid, handle) {  /* your code */ }\nfunction post(uid, handle, didThrow) {  /* your code */ }\nfunction destroy(uid) {  /* your code */ }\n```\n\nTo add hooks:\n\n```javascript\nasyncHook.addHooks({ init, pre, post, destroy });\n```\n\nTo remove hooks:\n\n```javascript\nasyncHooks.removeHooks({ init, pre, post, destroy });\n```\n\nAll properties in the hooks object that `addHooks` and `removeHooks` takes are\noptional.\n\n#### Providers\n\nThe providers map is exposed as:\n```\nasyncHook.providers[provider];\n```\n\n#### Enable and disable\n\nYou can enable and disable all hooks by using `asyncHook.enable()` and\n`asyncHook.disable()`. By default it is disabled.\n\nBe careful about disabling the hooks, this will most likely conflict with other\nmodules that uses `async-hook-jl`.\n","_attachments":{},"homepage":"https://github.com/jeff-lewis/async-hook-jl#readme","bugs":{"url":"https://github.com/jeff-lewis/async-hook-jl/issues"},"license":"MIT"}