Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

advanced-cache-js

Hemant-Bhardwaj12MIT1.0.0

A high-performance caching solution with multi-layer caching, cache invalidation strategies, and advanced features.

cache, caching, redis, memcached, in-memory, persistent, multi-layer, performance

readme

advanced-cache-js

A high-performance caching solution with advanced features.

Features

  • Multi-layer caching (in-memory, distributed cache, persistent storage)
  • Cache invalidation strategies (time-based, event-based, manual)
  • Integration with various cache stores (Redis, Memcached)
  • Cache warm-up and prefetching capabilities
  • Detailed cache hit/miss statistics and monitoring

Installation

npm install advanced-cache

Configuration

Create a config.js file in the src directory to manage the settings.

Usage

const CacheManager = require('advanced-cache-js');

(async () => {
  const cacheManager = new CacheManager();

  await cacheManager.set('key1', 'value1');
  const value = await cacheManager.get('key1');
  console.log(value); // Output: value1

  const stats = await cacheManager.stats();
  console.log(stats);
})();

Testing

Run tests with Mocha and Chai:

npm test

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.