README
@egomobile/redis
Redis classes and utilities for Node.js 12 or later.
Install
Execute the following command from your project folder, where your package.json
file is stored:
npm install --save @egomobile/redis
Usage
import RedisCache from "@egomobile/redis";
const cache = new RedisCache();
await cache.flush(); // remove all entries
// non existing values
await cache.get("foo"); // (undefined)
await cache.get("foo", "TM"); // "TM"
await cache.set("foo", "bar"); // set "bar" value to "foo" key
await cache.get("foo", "TM"); // "bar"
await cache.set("foo", null); // remove value
// alternative: await cache.set("foo", undefined)
await cache.get("foo", "TM"); // "TM"
Documentation
The API documentation can be found here.