![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.