
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@baileyherbert/events
Advanced tools
This is an alternative event emitter that works on all platforms. It allows you to specify the event types, and keeps
the emit
method protected.
npm install @baileyherbert/events
Extend the EventEmitter
class and provide an enumeration of tuples for <T>
:
import { EventEmitter } from '@baileyherbert/events';
export class Chat extends EventEmitter<Events> {
protected _onUserConnected(user: User) {
this.emit('connected', user.username);
}
}
type Events = {
/**
* These JSDoc comments will show up in intellisense too!
*/
chat: [username: string, message: string];
connected: [username: string];
disconnected: [username: string];
};
Then you can listen to those events like usual, but with autocompleted event names and typed arguments. 👍
const chat = new Chat();
chat.on('connected', username => {});
chat.on('disconnected', username => {});
chat.on('chat', (username, message) => {});
FAQs
A strongly typed event emitter.
The npm package @baileyherbert/events receives a total of 36 weekly downloads. As such, @baileyherbert/events popularity was classified as not popular.
We found that @baileyherbert/events 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.