Socket
Socket
Sign inDemoInstall

propagate

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

propagate

Propagate events


Version published
Weekly downloads
2.9M
decreased by-1.81%
Maintainers
1
Weekly downloads
 
Created

What is propagate?

The 'propagate' npm package is used to propagate events from one event emitter to another. This is particularly useful in scenarios where you want to forward events from one object to another seamlessly without manually emitting events from the second object.

What are propagate's main functionalities?

Event Propagation

This feature allows you to forward all events from one EventEmitter to another. In the provided code, events from 'emitter1' are propagated to 'emitter2', so when 'emitter1' emits an 'event', 'emitter2' also handles and logs the event.

const EventEmitter = require('events');
const propagate = require('propagate');

let emitter1 = new EventEmitter();
let emitter2 = new EventEmitter();

// Propagate all events from emitter1 to emitter2
propagate(emitter1, emitter2);

emitter1.on('event', () => console.log('Handled by emitter1'));
emitter2.on('event', () => console.log('Handled by emitter2'));

emitter1.emit('event'); // Logs from both emitter1 and emitter2

Other packages similar to propagate

FAQs

Package last updated on 03 Feb 2015

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