
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
This is a simple event bus that can handle event communication.
Starting with version 0.1.3 it does also support browsers - so you can use the same module in both, server and client.
This module can be expanded by using a bridge to pass event from a server to a different server, or from a client to a server, or from a server to a client.
This bridge does use websocket; and is included in a different package, se-bus-ws. Please read the description of the bridge, that module is still under active development.
There is a working demo at gitlab. Its demonstrating the usage of se-bus and se-bus-ws by hosting a small web application that clients can use to connect in real time.
import { on, once, many } from 'se-bus';
on('test', (params) => {
console.log(`Will be called every time the "test" event will be emitted`);
});
once('test', (params) => {
console.log(`Will be called once when the "test" event will be emitted`);
});
many(3, 'test', (params) => {
console.log(`Will be called 3 times the "test" event will be emitted`);
});
import { on, emit } from 'se-bus';
on('greet', (params) => {
console.log(`Hello ${params.name}`);
});
emit('greet', { name: 'Tino' });
Every call to on, once and many returns an object allowing to unregister it.
import { on, emit } from 'se-bus';
const eventInstance = on('greet', (params) => {
// this will never be called
console.log(`Hello ${params.name}`);
});
eventInstance.unregister();
emit('greet', { name: 'Tino' });
This module allows to handle multiple event callbacks at once.
This can be useful when using e.g. Vue.JS: in a component register for multiple events
on mount, on unmount unregister all event handler at once.
import { createEventStack, emit } from 'se-bus';
const eventStack = createEventStack();
eventStack
.on('greet', (params) => {
// This will be called every time the greet-event is being emitted
console.log(`Hello ${params.name}`);
})
.once('greet', (params) => {
// This will only be called once
console.log(`Haven't seen you in a long time`);
});
// Emit events as usual
emit('greet', { name: 'Tino' });
// Now unregister both events
eventStack.unregister();
FAQs
Simple event bus for handling events in all kind of ways
We found that se-bus 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.