Node Cache
Promise based cache Node module. It provides a single interface for Redis and Memcached basic methods.
How to install
npm install mpnode-cache --save
Methods
- set
- get
- setHash (Stores a JSON Object)
- getHash (Gets a JSON Object)
- delete
- getOrFetch
API
set([String] key, [String] val) : Promise
get([String] key) : Promise
setHash([String] key, [JSON] Object) : Promise
getHash([String] key) : Promise
delete([String] key): Promise
getOrFetch([String] key, [Function] callback(done)): Promise
client ;
Example
let cache = ; console; let client = "127.0.0.1" 6379 "redis"; client ; client ; let obj = 'att1':"val1"; client ; client ; client ; client ; client;
The road ahead
-
Replace with Spyies or Stubs both redis clients methods in unit tests
-
Implement auth support