Socket
Socket
Sign inDemoInstall

eventemitter-asyncresource

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eventemitter-asyncresource

AsyncResource integration for EventEmitter


Version published
Weekly downloads
1.7M
increased by3.09%
Maintainers
1
Install size
14.8 kB
Created
Weekly downloads
 

Readme

Source

eventemitter-asyncresource - AsyncResource integration for EventEmitter

Integrates EventEmitter with AsyncResource for EventEmitters that require manual async tracking.

const { EventEmitterAsyncResource } = require('eventemitter-asyncresource');

// Async tracking tooling will identify this as 'Q'.
const ee = new EventEmitterAsyncResource({ name: 'Q' });

// 'foo' listeners will run in this EventEmitter’s async context.P
ee.emit('foo');

The EventEmitterAsyncResource class has the same methods and takes the same options as EventEmitter and AsyncResource themselves.

It provides an .asyncResource property that allows accessing the async resource in question, which in turn provides the original EventEmitter via .eventEmitter, i.e. in the above example ee.asyncResource.eventEmitter === ee.

Keywords

FAQs

Last updated on 09 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc