All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Promise support for
wrap()- use async/await without callbacks - TypeScript type definitions (
index.d.ts) - GitHub Actions CI pipeline
- ESLint configuration
- Dependabot for automated dependency updates
cache.isReady()method to check store connection status- Redis connection timeout configuration (
connectTimeoutoption)
- BREAKING: Minimum Node.js version is now 18
- BREAKING: Rebranded from
obcachetoobcachejs - Upgraded
lru-cachefrom v2 to v11 - Upgraded
redisfrom v3 to v5 - Upgraded
debugto v4 - Redis
reset()now returns a Promise - LRU
expire()now calls callback asynchronously for consistency - Updated repository URLs to github.com/1mb-dev/obcachejs
- Race condition in Redis
keycount()returning stale data - Redis errors now propagate correctly (removed silent error suppression)
- CacheError now has proper
nameproperty for stack traces - Compatibility with modern Node.js versions
- LRU cache API compatibility issues
- Support for Node.js < 18
- Silent CacheError suppression (errors now propagate normally)
// Before
const obcache = require('obcache');
// After
const obcache = require('obcachejs');v1.0 requires Node.js 18 or higher.
Wrapped functions now support async/await:
// Callback style (still works)
cached(arg, (err, result) => {});
// Promise style (new)
const result = await cached(arg);// New option: connectTimeout (default 5000ms)
const cache = new obcache.Create({
redis: {
host: 'localhost',
port: 6379,
connectTimeout: 10000 // 10 seconds
},
id: 1
});
// Check connection status
if (cache.isReady()) {
// Redis is connected
}CacheError instances are no longer silently converted to success. If your code relied on this behavior, update error handling:
// Errors now propagate normally
try {
const result = await cached(arg);
} catch (err) {
// Handle error
}