Welcome to NatsPubsub
NatsPubsub is a production-ready pub/sub library for NATS JetStream with implementations in both TypeScript and Ruby.
๐ Quick Linksโ
โจ Key Featuresโ
- ๐ฏ Topic-Based Messaging - Simple, hierarchical topic pattern
- ๐ Declarative Subscribers - Clean DSL for defining subscribers
- ๐ฒ Wildcard Subscriptions - Support for
*and>wildcards - ๐ก๏ธ Inbox/Outbox Patterns - Transactional guarantees
- ๐งจ Dead Letter Queue - Automatic handling of failed messages
- โ๏ธ Durable Pull Consumers - Reliable message delivery
- ๐ญ Middleware System - Extensible processing pipeline
- ๐ TypeScript First - Full type safety (JavaScript package)
- ๐ Rails Integration - Deep ActiveRecord integration (Ruby package)
๐ฆ Choose Your Packageโ
JavaScript/TypeScriptโ
Perfect for Node.js microservices, perfect for modern JavaScript/TypeScript applications.
npm install nats-pubsub
Best For:
- Modern JavaScript/TypeScript applications
- Framework-agnostic projects
- Type-safe development
- Microservices architecture
Rubyโ
Perfect for Ruby on Rails applications with deep ActiveRecord integration.
gem install nats_pubsub
Best For:
- Rails applications
- Ruby microservices
- Teams needing Web UI
- Transactional guarantees with Inbox/Outbox
๐ Cross-Language Compatibilityโ
Both packages use identical event formats, enabling seamless communication across languages!
Ruby Service โ NATS โ JavaScript Service โ
JavaScript Service โ NATS โ Ruby Service โ
๐ Getting Startedโ
For detailed documentation and examples:
- JavaScript/TypeScript: See the package README and examples
- Ruby: See the package README and Rails Quick Start
๐ค Contributingโ
We welcome contributions! See CONTRIBUTING.md for guidelines.
๐ Licenseโ
MIT License - see LICENSE for details.