Skip to content

medishen/qiks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

81 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

QIKS Logo

QIKS

High-Performance TypeScript Caching Library
Smart Caching for Modern Applications


๐Ÿ” Introduction

QIKS is a next-generation caching solution designed for TypeScript/JavaScript applications requiring blazing-fast in-memory operations, enterprise-grade features, and unparalleled flexibility. Born from real-world needs in high-traffic systems, QIKS combines robust caching fundamentals with innovative capabilities.

๐Ÿš€ Why Choose QIKS?

Feature Benefit
ยตs-level Operations Handle 1M+ ops/sec with sub-millisecond latency
Military-Grade Eviction LRU, LFU, MRU
Real-Time Insights Built-in monitoring with 20+ metrics
Event-Driven Architecture 12+ event types with microsecond response
TypeSafeโ„ข Guarantee Full TypeScript generics support
Storage Agnostic Map, WeakMap, or bring your own adapter

๐ŸŒŸ Features

Core Capabilities

  • Lightning-Fast CRUD
    Atomic operations with O(1) complexity
  • Hybrid Expiration
    TTL + idle timeout + manual expiration
  • Dependency Graph
    Automatic cascade invalidation
    cache.set('order:123', data, {
      dependsOn: 'user:45',
    });
  • Namespace Isolation
    Logical separation without multiple instances
    const userCache = cache.namespace('users');

Advanced Features

  • CacheTools Suite

    • BatchOps: Bulk insert/update/delete
    • Functional: Map/filter/reduce pipelines
    • FileOps: Disk persistence & hydration
    // Batch insert 1K items
    cache.cacheTools.batchOps.setBatch(massiveDataset);
    
    // Save to disk
    await cache.cacheTools.fileOps.export('backup.json');
  • Event System

    cache.on(EventType.Expire, ({ key }) => {
      console.log(`Expired: ${key}`);
    });
  • Adaptive Memory Management
    Automatic scaling with heap pressure detection


๐Ÿ“ฆ Installation

npm install @medishn/qiks
# or
yarn add @medishn/qiks

๐Ÿ›  Usage

Basic Setup

import { Qiks } from '@medishn/qiks';

interface UserProfile {
  id: string;
  name: string;
}

// Create a cache instance with custom configuration
const cache = new Qiks<string, UserProfile>({
  maxSize: 10000, // Maximum number of items
  evictionPolicy: 'LRU', // Eviction strategy
  storage: 'map', // Use native Map for storage
});

// Set a cache entry with a TTL (in milliseconds)
cache.set('user:123', { id: '123', name: 'Alice' }, { ttl: 60000 });

// Retrieve the cache entry
const user = cache.get('user:123');
console.log(user); // Outputs: { id: '123', name: 'Alice' }

// Use namespaces to isolate cache entries
const userCache = cache.namespace('users');
userCache.set('456', { id: '456', name: 'Bob' });
console.log(userCache.get('456')); // Outputs: { id: '456', name: 'Bob' }

๐Ÿ“š Documentation

Resource Description Link
Core Concepts Architecture & Design Philosophy Wiki
API Reference Complete Method Documentation API Docs

๐Ÿค Contributing

We welcome contributions! Please follow our
Contribution Guidelines.

Quick Start for Devs:

git clone https://github.com/medishen/qiks.git
cd qiks
npm install
npm run test

๐Ÿ“œ License

MIT License - See LICENSE


๐Ÿ“ฌ Contact

Channel Details
Issues GitHub Issues
Discussions Q&A Forum
Email [email protected]

QIKS - Because Your Data Deserves Speedยฎ
An open-source project by MediSHN Technologies