General cache abstraction layer providing a unified front-end for cache access independent of the underlying technology. Version 1.0.9 ships with three built-in providers: dummy, memory, and Redis. The package requires additional infrastructure (Consul and Redis) when using the Redis backend. It uses a Promise-based API and is designed for Node.js environments. Minimal setup involves creating a Cache instance with optional configuration for driver, key prefix, default expiration, and plugin directory. The library is part of the OpusCapita ecosystem and has seen limited updates since its initial release.
npm install ocbesbn-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic Cache usage with memory driver: put, get, remove operations.
Ensure Consul and Redis are accessible, or use memory/dummy driver.
Use new Cache({ driver: 'memory' }) instead of new Cache('memory').Use .then() or async/await instead of callbacks.
Avoid relying on custom plugin directory; use built-in drivers.
Use CommonJS require: const Cache = require('ocbesbn-cache');Start Redis server and ensure Consul provides correct endpoint.
Verify that Cache was instantiated correctly with the new operator.
No dependency data recorded yet.