Skip to content

Releases: yidinghan/redis-client-side-simple-cache

v0.3.0

Choose a tag to compare

@yidinghan yidinghan released this 31 Oct 08:55

🎉 Custom Map Class Support

Version 0.3.0 adds support for custom Map implementations, enabling advanced caching strategies like LRU eviction, size limits, and
custom monitoring.

✨ New Features

  • Custom Map Classes: Pass your own Map implementation via CacheMapClass and KeyMapClass options
  • Type Safety: Automatic validation ensures classes extend native Map
  • Backward Compatible: Defaults to native Map when not specified

📝 Usage Example

class LRUMap extends Map {
  constructor(maxSize = 1000) {
    super();
    this.maxSize = maxSize;
  }

  set(key, value) {
    if (this.size >= this.maxSize) {
      const firstKey = this.keys().next().value;
      this.delete(firstKey);
    }
    return super.set(key, value);
  }
}

const cache = new SimpleClientSideCache({
  CacheMapClass: LRUMap,
  KeyMapClass: LRUMap
});

📦 What's Included

  • 8 new comprehensive tests
  • Example implementations: LRUMap, LimitedMap, MonitoredMap
  • Updated documentation with usage guide

🔗 Links

Full Changelog: v0.2.0...v0.3.0

v0.2.2

Choose a tag to compare

@yidinghan yidinghan released this 31 Oct 05:16

🐛 v0.2.2 - Package Size Fix

Bug Fixes

  • 🔧 Fix: Remove docs files from npm package (package.json files field had higher priority than .npmignore)
  • 📦 Package size reduced: now only includes essential files (src, README, LICENSE)

Package Contents

Now only 4 files in npm package:

  • src/simple-cache.js - Core implementation (~7.5KB)
  • README.md - Documentation
  • LICENSE - License file
  • package.json - Package metadata

Package size: 6.9 KB (tarball), 17.2 KB (unpacked)

Note: Full documentation is still available on GitHub
repository

Full Changelog: v0.2.1...v0.2.2

v0.2.1

Choose a tag to compare

@yidinghan yidinghan released this 31 Oct 03:32

Full Changelog: v0.2.0...v0.2.1

v0.2.0 - Statistics Support

Choose a tag to compare

@yidinghan yidinghan released this 31 Oct 03:24

Full Changelog: v0.1.1...v0.2.0