Distributed LRU cache invalidation via RabbitMQ, built on top of lru-cache and amqplib. Current stable version 5.0.0 (Node >=20). Provides automatic cache invalidation across multiple instances when a key is deleted or cache is cleared via RabbitMQ fanout exchange. Key differentiators: built-in reconnection with automatic cache reset, concurrency handling (Thundering herd protection) via getOrLoad, and TypeScript support. Release cadence: mature, actively maintained.
npm install rabbit-lru-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a distributed LRU cache, adds a listener for invalidation messages, uses getOrLoad to fetch/cache a value, deletes the key, and gracefully closes.
Use import createRabbitLRUCache from 'rabbit-lru-cache' in ESM, or const createRabbitLRUCache = require('rabbit-lru-cache').default in CJS.Upgrade Node to version 20 or later.
Handle getOrLoad failures or cache misses during reconnection by retrying or using fallback.
Verify RabbitMQ permissions for exchange creation on the virtual host.
Use const createRabbitLRUCache = require('rabbit-lru-cache').default;Run npm install rabbit-lru-cache
Upgrade to Node >=20 as required by v5.0.0