
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@ws-kit/memory
Advanced tools
In-memory adapters for WS-Kit. Provides a zero-dependency pub/sub registry and token-bucket rate limiter for single-instance development and tests (Bun/Node.js).
memoryPubSub() — In-memory topic index (Map<topic, Set<clientId>>). Implements publish, subscribe, unsubscribe, getSubscribers, listTopics, hasTopic, and replace for bulk topic swaps. excludeSelf filtering is handled by the pubsub plugin layer.memoryRateLimiter(policy, opts?) — Token-bucket limiter with per-key mutex to prevent double spending. Supports prefix isolation, getPolicy(), dispose(), and optional clock injection for deterministic tests.MemoryPubSubAdapter, MemoryRateLimiterOptions, Clock.bun add @ws-kit/memory
import { createRouter, withZod, message } from "@ws-kit/zod";
import { withPubSub } from "@ws-kit/plugins";
import { memoryPubSub } from "@ws-kit/memory";
import { z } from "zod";
const Notify = message("NOTIFY", { text: z.string() });
const router = createRouter()
.plugin(withZod())
.plugin(withPubSub({ adapter: memoryPubSub() })); // exact local fan-out
router.on(Notify, async (ctx) => {
await ctx.topics.subscribe("room:lobby");
await ctx.publish("room:lobby", Notify, { text: "Hi!" });
});
import { createRouter } from "@ws-kit/core";
import { rateLimit, keyPerUserPerType } from "@ws-kit/rate-limit";
import { memoryRateLimiter } from "@ws-kit/memory";
const limiter = memoryRateLimiter({
capacity: 100, // bucket size
tokensPerSecond: 10, // refill rate
prefix: "api:", // optional isolation when sharing a backend
});
const router = createRouter().use(
rateLimit({
limiter,
key: keyPerUserPerType,
cost: () => 1,
}),
);
@ws-kit/redis or a Durable Objects adapter for shared limits.{ clock: { now: () => number } } to memoryRateLimiter().FAQs
In-memory rate limiter and pub/sub adapter for WS-Kit
We found that @ws-kit/memory demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.