
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
event-message-center
Advanced tools
基于 JS 发布订阅模式实现的一个事件消息中心
https://hunter1024.blog.csdn.net/article/details/124452792
npm install event-message-center
或
yarn add event-message-center
或
pnpm install event-message-center
import { messageCenter } from "event-message-center";
const { messageCenter } = require("event-message-center");
<script src="./node_modules/event-message-center/dist/umd/index.js"></script>
<script>
console.log(MessageCenter);
</script>
const bus = new MessageCenter();
const bus = messageCenter;
messageCenter.on("a", funcA);
messageCenter.emit("a", { state: "stop" });
messageCenter.un("a", funcA);
messageCenter.un("a");
messageCenter.once("a", funcA);
messageCenter.clear();
messageCenter.has("a");
messageCenter.handlerLength("a");
messageCenter.watch("b", funcB);
messageCenter.invoke("b", { num1: 1, num2: 2 }).then((result) => {
console.log(result);
});
const messageCenter2 = new MessageCenter({ blackList: ["c"], maxLen: 2 });
messageCenter2.on("c", () => {}); // c is not allow
messageCenter2.on("b", () => {});
messageCenter2.on("b", () => {});
messageCenter2.on("b", () => {}); // the number of b must be less than 2
FAQs
We found that event-message-center 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
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.