Repository navigation
Releases: yidinghan/redis-client-side-simple-cache
Releases · yidinghan/redis-client-side-simple-cache
Release list
v0.3.0
🎉 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
CacheMapClassandKeyMapClassoptions - 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
🐛 v0.2.2 - Package Size Fix
Bug Fixes
- 🔧 Fix: Remove docs files from npm package (package.json
filesfield 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- DocumentationLICENSE- License filepackage.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
v0.2.0 - Statistics Support
Full Changelog: v0.1.1...v0.2.0