cache-manager-hazelcast

Node Cache Manager for Hazelcast


License
MIT
Install
npm install cache-manager-hazelcast@0.2.1

Documentation

Node Cache Manager store for Hazelcast

A Hazelcast store for the node-cache-manager module.

Installation

npm install --save cache-manager-hazelcast

Usage examples

var cacheManager = require('cache-manager');
var hazelcastStore = require('cache-manager-hazelcast');

var hazelcastCache = cacheManager.caching({
  store: hazelcastStore,
  defaultMap: 'CACHE' // Default Value is 'CACHE'
  host: 'localhost',
  port: 5701,
  prefix: 'MapPrefix',
  ttl: 60,
});

hazelcastCache.set('foo', 'bar', {
  mapName: 'CustomMapName',
  ttl: 120,
}); // returns Promise

hazelcastCache.get('foo', {
  mapName: 'CustomMapName',
}) // returns Promise

hazelcastCache.del('foo', {
  mapName: 'CustomMapName',
}) // returns Promise

API

constructor Options
{
  defaultMap?: string,
  host?: string,
  port?: string,
  prefix?: string,
  ttl?: number,
}
General Options
{
  mapName?: string,
}
Set options
{
  mapName?: string,
  ttl?: number,
}