
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
channel-emitter
Advanced tools
npm i --save channel-emitter
/* a.js */
var channelEmitter = require('channel-emitter');
channelEmitter.on('foo', function () { console.log(arguments); });
/* b.js */
var channelEmitter = require('channel-emitter');
channelEmitter.emit('foo', true, {foo: []}, 123);
/* c.js */
require('./a');
require('./b');
// outputs: { '0': true, '1': { foo: [] }, '2': 123 }
/* a.js */
var channelEmitter = require('channel-emitter');
channelEmitter.on('foobar', function () { console.log('foobar: ', arguments); });
channelEmitter.on('foo.bar', function () { console.log('foo.bar: ', arguments); });
channelEmitter.emit('foobar', 'hi');
// returns true;
// outputs: foobar: { 0: 'hi' }
channelEmitter.emit('bar', 'hello');
// returns false;
// outputs:
channelEmitter.emit('foo.foobar', 'hi');
// returns true;
// outputs: foobar: { 0: 'hi' }
channelEmitter.emit('foo.bar', 'hello');
// returns true;
// outputs: foo.bar: { 0: 'hello' }
channelEmitter.broadcast('foobar', 'hi');
// returns true;
// outputs: foobar: { 0: 'hi' }
channelEmitter.broadcast('bar', 'hello');
// returns true;
// outputs: foo.bar: { 0: 'hello' }
channelEmitter.broadcast('foo.foobar', 'hi');
// returns false;
// outputs:
channelEmitter.broadcast('foo.bar', 'hello');
// returns true;
// outputs: foo.bar: { 0: 'hello' }
Example
var channel_emitter = require('channel-emitter');
ChannelEmitter
Wrapper for the EventEmitter.addListener
method that will auto-add channels
if the specified delimiter is used in the name.
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
eventName | string | the name for the event |
listener | function | the listener for the event |
ChannelEmitter
Wrapper for the EventEmitter.removeListener
method that will remove
events from a specified channl if the specified delimiter is used in the name.
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
eventName | string | the name for the event |
listener | function | the listener for the event |
ChannelEmitter
Wrapper for the EventEmitter.removeAllListeners
method that will remove
if the specified delimiter is used in the name.
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
[eventName] | string | the name for the event |
ChannelEmitter
Wrapper for the EventEmitter.listenerCount
method that will return the
listener count on a channel (including name-spaced events).
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
eventName | string | the name for the event |
ChannelEmitter
Wrapper for the EventEmitter.listeners
method that will return the
listeners on a channel (including name-spaced events).
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
eventName | string | the name for the event |
ChannelEmitter
Wrapper for the EventEmitter.on
method that will auto-add channels
if the specified delimiter is used in the name.
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
eventName | string | the name for the event |
listener | function | the listener for the event |
ChannelEmitter
Adds a sub-channel to the current channel.
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
channelName | string | the name for the channel |
ChannelEmitter
Removes the sub-channel from the current channel.
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
channelName | string | the name for the channel |
Boolean
EventEmitter wrapper that emits an event to siblings and direct ancestor channels.
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
eventName | string | the name for the registered event |
[...args] | * | arguments to emit to the event |
Boolean
Broadcasts an event to siblings and descendent channels.
Kind: inner method of channel-emitter
Param | Type | Description |
---|---|---|
eventName | string | the name for the registered event |
[...args] | * | arguments to broadcast to the event |
Apache 2.0
FAQs
An event emitter with channel and broadcast support
The npm package channel-emitter receives a total of 4 weekly downloads. As such, channel-emitter popularity was classified as not popular.
We found that channel-emitter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.