
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
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.
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
EventEmitter2 is an implementation of EventEmitter with additional features like namespaces, wildcards, and timesToListen. It offers more flexibility and functionality compared to 'propagate' which mainly focuses on forwarding events.
EventEmitter3 is a high performance EventEmitter primarily focused on performance. While it does not offer direct event propagation like 'propagate', it is optimized for a high number of events and listeners, making it suitable for performance-critical applications.
Propagate events from one event emitter into another.
$ npm install propagate
var ee1 = new EventEmitter()
var ee2 = new EventEmitter()
propagate(ee1, ee2)
ee2.on('event', function(a, b) {
console.log('got propagated event', a, b)
})
ee1.emit('event', 'a', 'b')
You can unpropagate by ending the propagation like this:
var ee1 = new EventEmitter()
var ee2 = new EventEmitter()
var p = propagate(ee1, ee2)
// ...
p.end()
var ee1 = new EventEmitter()
var ee2 = new EventEmitter()
var p = propagate(['event1', 'event2'], ee1, ee2)
var ee1 = new EventEmitter()
var ee2 = new EventEmitter()
var p = propagate(
{
event1: 'other-event1',
event2: 'other-event2',
},
ee1,
ee2
)
MIT
FAQs
Propagate events from one event emitter into another
The npm package propagate receives a total of 0 weekly downloads. As such, propagate popularity was classified as not popular.
We found that propagate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
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.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.