
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
Personally I hate it to check if something is in a map, and if not add an object. So, I always write this small snippet, I decided to make a repo out of it.
A simple example;
import {WeakMapExt} from "map-ext";
type EventHandler = (...[]) => any;
const eventStore = new WeakMapExt<object, MapExt<string, Set<EventHandler>>>(() => new MapExt(() => new Set()));
class Events {
async emit(key: string, ...args: any[]) {
for (const cb of eventStore.get(this).get(key)) {
await cb(...args);
}
}
on(key: string, cb: EventHandler) {
eventStore.get(this).get(key).add(cb);
}
off(key: string, cb: EventHandler) {
eventStore.get(this).get(key).delete(cb);
}
}
Since this package is so small it supports both esm and commonjs
FAQs
map-ext
The npm package map-ext receives a total of 49 weekly downloads. As such, map-ext popularity was classified as not popular.
We found that map-ext 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
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.