Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CacheFlow

Simple and powerful caching for Node.js. Local memory and Redis made easy.

NPM Version License

Quick Start

npm install @cr7bit/cacheflow
import { 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);
});

Features

  • 🚀 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

Documentation

📚 Full Documentation - Visit our documentation website for:

  • Getting Started Guide
  • Complete API Reference
  • Real-world Examples
  • Docker Setup Guide
  • Why CacheFlow?

Quick Links

Configuration

Create a .env file:

# Optional - defaults to local cache
REDIS_ENABLED=true
REDIS_URL=redis://localhost:6379
DEFAULT_TTL=3600

Docker

docker-compose up -d

See Docker Guide for details.

License

MIT © Utsav Rai


Made with ❤️ by developers, for developers

About

Simple & powerful Node.js caching library. Dual-layer (local + Redis) with auto-failover. <1ms latency. Published on NPM.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages