Use Redis' commands straight-forward, with no need to remember the complicated Redis API in mind.
let redisList = new RedisList('mykey');
let index = await redisList.push('str1');
let data = await redisList.pop();
console.log(index); // Will print 0
console.log(data); // Will print 'str1'
Since wrap all Redis commands can take long time, you're welcome to contribute ;)
- Node > 10
- Tested on Redis 2.8.2400
npm i rediss -S
Note: objects can save mixed JavaScript data, it's means that when saving a value will fetch exactly as saved - with the same type,
objects will internally JSON.stringify
before save and JSON.parse
after fetch
- Redis Base (abstract)
- Redis Simple object inherit Redis Base
- Redis Set inherit Redis Base
- Redis Hash inherit Redis Base
- Redis List inherit Redis Base
- Redis PUBSUB
RedisError
A readonly error that contain the reason something has failed