npm.io
1.0.18 • Published 6 years ago

cache_star

Licence
ISC
Version
1.0.18
Deps
2
Size
56 kB
Vulns
1
Weekly
0

Cache Star

Cache Star is a Redis - In memory simple binder, using under the hood Redis pub-sub methods and lazy loads to in memory object, return promises.

Installation

Cache Star requires Node.js v6+ to run. Install the dependencies and devDependencies and start the server.

$ npm install cache_star --save

Usage Examples

In your node app

 let cacheStar = require(‘cache_star’);
 let redisConObj = { port: 'myRedisPort', host: 'myRedisHost', password: 'myRedisPass' };
 let cachStarManger = new cacheStar(redisConObj);

cachStarManger.get(‘myRedisHash’, ‘myRedisHashKey’).then((hashVal) => {
    // do something	
});

cachStarManger.set(‘myRedisHash’, ‘myRedisHashKey’, objToSave).then((ans) => {
	// do something
});

cachStarManger.del(‘myRedisHash’, ‘myRedisHashKey’).then((hashVal) => {
	// do something
});

Supports:

currently support 4 redis methods

  • get
  • getAll
  • set
  • del

Tech

Cache Star uses a number of open source projects to work properly:

  • [Node_Redis] - redis client for node.
  • [Bluebird] - Bluebird is a full featured promise library with unmatched performance.