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

propagate

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

propagate

Propagate events from one event emitter into another

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
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

Keywords

FAQs

Package last updated on 12 Apr 2019

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