A Deno client library for the NATS cloud-native messaging system, enabling publish-subscribe, request-reply, and queueing patterns.
NATS.deno is a client library for the NATS messaging system, specifically designed for the Deno runtime. It enables Deno applications to leverage NATS for real-time, scalable communication using patterns like publish-subscribe, request-reply, and queue groups. It solves the problem of building distributed, cloud-native systems with a lightweight and performant messaging backbone.
Deno developers building microservices, real-time applications, or distributed systems that require reliable, high-performance messaging. It's also suitable for teams migrating from Node.js NATS clients to Deno or adopting NATS in new Deno projects.
Developers choose NATS.deno because it provides a first-class, type-safe NATS experience in Deno with a modern async/await API, comprehensive feature support (including JetStream and services), and seamless integration with Deno's module system and security model.
Deno client for NATS, the cloud native messaging system
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a promise-based, async/await interface aligned with contemporary JavaScript/TypeScript, making distributed system code cleaner and more maintainable, as shown in examples like `for await (const m of sub)` for subscriptions.
Supports multiple auth methods including username/password, tokens, NKEYS, JWTs, and client certificates, offering flexibility for secure cloud-native deployments, detailed in the Authentication section with code snippets.
Features automatic reconnection, configurable timeouts, and graceful draining for subscriptions and connections, ensuring reliability in distributed environments, as demonstrated in connection examples and lifecycle events.
Includes built-in codecs for JSON and string payloads with TypeScript generics, plus the ability to create custom codecs, simplifying data serialization in messages, as seen in the JSONCodec examples.
The project is now part of nats.js, requiring changes documented in migration.md, which can introduce breaking changes and extra effort for existing users to update their codebase.
Using async iterators for subscriptions can increase latency due to microtask queue processing, as admitted in the README's 'Async vs. Callbacks' section, where callbacks are offered as a more performant but less modern alternative.
Setting up NKEY or JWT authentication involves reading credentials from files or dynamic sources, adding complexity compared to simpler token-based auth, as outlined in the Authenticators section with multi-step examples.