node-redis-cache
A clean redis cache lib based on ioredis.
Features
- Make cache much easier
- Multiple ES6 features are applied
- Most of the APIs support pipeline
- The Promise lib in your own code must support
.tap()
, we highly recommend bluebird - Chain style usage, whenever in or not in a pipeline
- When you query data from database, it can be auto-saved in cache without your own extra operation, making next queries much faster.
Usage
$ npm install node-redis-cache --save
Example
What we export from the package is a Class, so you can use it like this in your own code:
let cache = new ;let Promise = ; cache; cache;
If you want to new
a Cache instance, the parameters you can pass to the constructor is totally the same with ioredis(also with the same call pattern).
API Doc
Practice Project
ChangeLog
Change Log of node-redis-cache
Join Me
I'll keep updating APIs of redis to satisfy multiple needs. And you are welcomed to join me to make it better: Fork -> Edit -> Pull Request.
Also, any issues are welcomed, I'm all ears.
:D
Test
$ npm run test
Make sure you have installed Redis and mocha before that.
License
MIT