Simple and powerful caching for Node.js. Local memory and Redis made easy.
npm install @cr7bit/cacheflowimport { createCache } from '@cr7bit/cacheflow';
// Create cache
const cache = await createCache();
// Cache your data - it's that simple!
const user = await cache.getOrFetch('user:123', async () => {
return await database.getUser(123);
});- 🚀 Simple - 3 lines to get started
- ⚡ Fast - In-memory Map-based caching
- 📈 Scalable - Add Redis when you need it
- 🛡️ Production Ready - Auto-reconnect, health checks, graceful shutdown
- 🔄 Smart Failover - Automatic Redis → Local fallback
- 🧹 Auto Cleanup - Scheduled expiration management
📚 Full Documentation - Visit our documentation website for:
- Getting Started Guide
- Complete API Reference
- Real-world Examples
- Docker Setup Guide
- Why CacheFlow?
Create a .env file:
# Optional - defaults to local cache
REDIS_ENABLED=true
REDIS_URL=redis://localhost:6379
DEFAULT_TTL=3600docker-compose up -dSee Docker Guide for details.
MIT © Utsav Rai
Made with ❤️ by developers, for developers