0.0.4 • Published 5 months ago

cache-vision v0.0.4

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
5 months ago

šŸš€ CacheVision – High-Performance Cache Manager with Redis

Test Coverage Pipeline Status NPM Version NPM License NPM Type Definitions

šŸ”„ Overview

CacheVision is a lightweight, pluggable cache manager for Node.js that supports Redis as a caching backend. Built for high-performance applications, it enables seamless caching strategies with an easy-to-use API.

✨ Features

āœ… Pluggable Cache Strategy – Supports Redis, easily extendable for others
āœ… High Performance – Optimized for speed and efficiency
āœ… TTL Support – Set expiration times for cache entries
āœ… Simple API – Minimal configuration, ready to use

šŸ“¦ Installation

npm install cachevision redis

šŸš€ Usage

Basic Setup

import { CacheManager, RedisCacheStrategy } from 'cachevision';

const cache = new CacheManager(new RedisCacheStrategy());

// Set a cache entry
await cache.set('user:123', JSON.stringify({ name: 'John Doe' }), 3600);

// Get a cache entry
const userData = await cache.get('user:123');
console.log(JSON.parse(userData || '{}'));

// Delete a cache entry
await cache.delete('user:123');

šŸ›  API Reference

CacheManager

MethodDescription
set(key, value, cache?, ttl?)Stores a value in cache with optional cache (default = true), TTL (default = 3600ms)
get(key)Retrieves a value from cache
delete(key)Removes a key from cache
getStats()Returns cache hit/miss statistics

šŸ— Roadmap

  • Add Visualization for stats
  • Add support for in-memory caching
  • Implement a multi-cache strategy
  • Performance benchmarking

šŸ† Contributing

We welcome contributions! Please check out our CONTRIBUTING.md.

šŸ“œ License

This project is licensed under the MIT License.

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago