Skip to main content

Welcome to NatsPubsub

NatsPubsub is a production-ready pub/sub library for NATS JetStream with implementations in both TypeScript and Ruby.

โœจ 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:

๐Ÿค Contributingโ€‹

We welcome contributions! See CONTRIBUTING.md for guidelines.

๐Ÿ“„ Licenseโ€‹

MIT License - see LICENSE for details.