{"_id":"eventemitter-asyncresource","_rev":"2779762","name":"eventemitter-asyncresource","description":"AsyncResource integration for EventEmitter","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"addaleax","email":"anna@addaleax.net"}],"time":{"modified":"2022-06-06T08:22:47.000Z","created":"2020-05-09T00:30:58.066Z","1.0.0":"2020-05-09T00:30:58.066Z"},"users":{},"author":{"name":"Anna Henningsen","email":"anna@addaleax.net"},"repository":{"type":"git","url":"git+https://github.com/addaleax/eventemitter-asyncresource.git"},"versions":{"1.0.0":{"name":"eventemitter-asyncresource","version":"1.0.0","description":"AsyncResource integration for EventEmitter","main":"./dist/src/index.js","exports":{"import":"./dist/esm-wrapper.mjs","require":"./dist/src/index.js"},"types":"./dist/src/index.d.ts","scripts":{"build":"tsc && gen-esm-wrapper . dist/esm-wrapper.mjs","lint":"standardx \"**/*.{ts,mjs,js,cjs}\" | snazzy","test":"npm run lint && npm run build && npm run test-only","test-only":"tap","prepack":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/addaleax/eventemitter-asyncresource.git"},"keywords":["EventEmitter","AsyncResource","async_hooks","events"],"author":{"name":"Anna Henningsen","email":"anna@addaleax.net"},"license":"MIT","devDependencies":{"@types/node":"^13.13.5","@typescript-eslint/eslint-plugin":"^2.28.0","@typescript-eslint/parser":"^2.28.0","gen-esm-wrapper":"^1.0.0","snazzy":"^8.0.0","standardx":"^5.0.0","tap":"^14.10.7","typescript":"^3.8.3"},"eslintConfig":{"rules":{"semi":["error","always"],"no-unused-vars":"off","@typescript-eslint/no-unused-vars":"error"}},"standardx":{"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint/eslint-plugin"]},"gitHead":"8e83f3dc9ddc4f09d0ddad4fb34c5930952c2424","bugs":{"url":"https://github.com/addaleax/eventemitter-asyncresource/issues"},"homepage":"https://github.com/addaleax/eventemitter-asyncresource#readme","_id":"eventemitter-asyncresource@1.0.0","_nodeVersion":"15.0.0-pre","_npmVersion":"6.14.4","dist":{"shasum":"734ff2e44bf448e627f7748f905d6bdd57bdb65b","size":4949,"noattachment":false,"key":"/eventemitter-asyncresource/-/eventemitter-asyncresource-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eventemitter-asyncresource/download/eventemitter-asyncresource-1.0.0.tgz"},"maintainers":[{"name":"addaleax","email":"anna@addaleax.net"}],"_npmUser":{"name":"addaleax","email":"anna@addaleax.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eventemitter-asyncresource_1.0.0_1588984257962_0.45417605496629365"},"_hasShrinkwrap":false,"publish_time":1588984258066,"_cnpm_publish_time":1588984258066,"_cnpmcore_publish_time":"2021-12-16T21:08:41.508Z"}},"readme":"# eventemitter-asyncresource - AsyncResource integration for EventEmitter\n\nIntegrates [`EventEmitter`][] with [`AsyncResource`][] for `EventEmitter`s that\nrequire manual async tracking.\n\n```js\nconst { EventEmitterAsyncResource } = require('eventemitter-asyncresource');\n\n// Async tracking tooling will identify this as 'Q'.\nconst ee = new EventEmitterAsyncResource({ name: 'Q' });\n\n// 'foo' listeners will run in this EventEmitter’s async context.P\nee.emit('foo');\n```\n\nThe `EventEmitterAsyncResource` class has the same methods and takes the same\noptions as `EventEmitter` and `AsyncResource` themselves.\n\nIt provides an `.asyncResource` property that allows accessing the async\nresource in question, which in turn provides the original `EventEmitter` via\n`.eventEmitter`, i.e. in the above example\n`ee.asyncResource.eventEmitter === ee`.\n\n[`EventEmitter`]: https://nodejs.org/api/events.html#events_class_eventemitter\n[`AsyncResource`]: https://nodejs.org/api/async_hooks.html#async_hooks_class_asyncresource\n","_attachments":{},"homepage":"https://github.com/addaleax/eventemitter-asyncresource#readme","bugs":{"url":"https://github.com/addaleax/eventemitter-asyncresource/issues"},"license":"MIT"}