Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eventemitter-asyncresource

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eventemitter-asyncresource

AsyncResource integration for EventEmitter

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
999K
decreased by-10.56%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 09 May 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc