npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zenofolio/hyper-decor

v2.10.0

Published

Project core with utilities and features

Readme

@zenofolio/hyper-decor

High-performance decorator library for HyperExpress.

hyper-decor provides a modular, reactive architecture based on metadata for building robust APIs and distributed systems, focusing on efficiency, decoupling, and testability.


📚 Documentation Index

| Topic | Description | Link | |-------|-------------|------| | Getting Started | Installation and Full App Example | Read Guide | | Architecture | Modules, Controllers and Services | Read Guide | | NatsMQ (Messaging) | Contracts, Dynamic Sharding and High Performance | Read Guide | | Concurrency Control | Distributed Locking and Cluster-Wide Limits | Read Guide | | OpenAPI | Automatic Swagger Spec Generation | Read Guide |


⚡ Quick Start

1. Web API Architecture

Organize your HyperExpress application into clean, injectable components.

@HyperController("/users")
class UserController {
  @Get("/:id")
  async getUser(req: Request, res: Response) {
    return res.json({ id: req.params.id, name: "Zeno" });
  }
}

@HyperModule({
  controllers: [UserController]
})
class MainModule {}

const app = new HyperApp({ 
  port: 3000, 
  modules: [MainModule] 
});
await app.listen();

2. High-Fidelity Messaging (NatsMQ)

Decouple your services with type-safe contracts and cluster-wide performance (30,000+ msg/sec).

// Define a type-safe contract
const Tasks = defineQueue("jobs");
const ProcessTask = Tasks.define("process", z.object({ id: z.number() }));

@NatsMQWorker(Tasks)
class WorkerSvc {
  @OnNatsMessage(ProcessTask)
  @MaxAckPendingPerSubject("jobs.process", 10) // Cluster-wide concurrency limit
  async handle(data: { id: number }) {
    console.log(`Processing task ${data.id}`);
  }
}

3. Dynamic Subject Sharding

Scale your concurrency per resource (e.g., per user) using dynamic lock keys.

// Contract with named parameters
const UserTasks = Tasks.define("user.:id", TaskSchema);

@NatsMQWorker(Tasks)
class ShardedWorker {
  @OnNatsMessage(UserTasks)
  // Engine resolves :id from the message subject for granular locking
  @MaxAckPendingPerSubject("jobs.user.:id", 1) 
  async handle(data: any) {
    // Only 1 concurrent task per USER across the whole cluster
  }
}

// Publish to a specific shard
await engine.publish(UserTasks.fill({ id: "123" }), data);

💎 Key Features

  • 🚀 Extreme Throughput: Optimized for high-fidelity messaging, reaching 30,000+ msg/sec with NATS JetStream.
  • 🧩 Modular DI: Full dependency injection powered by tsyringe across Modules, Controllers, and Services.
  • 📜 Contract-First Messaging: Eliminate "string-based" events. Use Zod-powered contracts for total type safety.
  • ⚖️ Distributed Concurrency: Enforce global execution limits via Redis backends with local retry/jitter to avoid NAK storms.
  • ⏰ Distributed Cron: Ensure cron tasks run exactly once per cluster using temporal bucketing and TTL locks.
  • 📊 Unified Monitoring: Real-time stats dashboard via mq.count() aggregating data from Business Metrics, NATS JetStream, and Concurrency Store.
  • 🛡️ OpenAPI / Swagger: Automatic generation of Swagger specifications directly from your decorators.

🛠️ Recent Improvements (v2.9.3)

  • 🧩 DI Stability: Hardened prepareApplication and ensureResolvable to properly handle container.reset() in test environments, ensuring singletons are correctly re-registered.
  • 📡 Messaging Precision: Fixed Trie-based wildcard matching logic in InternalTransport to strictly adhere to segment levels (e.g., user.* no longer matches user.a.b).
  • 🛡️ MessageBus Idempotency: registerTransport is now idempotent, preventing duplicate messaging pipelines during multiple re-bootstraps.
  • 🧪 Test Isolation: Added best practices for DI-based testing using afterEach(() => container.reset()).

Installation

npm install @zenofolio/hyper-decor
# Optional dependencies for distributed features
npm install nats ioredis

License

MIT