@egomobile/redis

Redis classes and utilities for Node.js 12 or later.

Usage no npm install needed!

<script type="module">
  import egomobileRedis from 'https://cdn.skypack.dev/@egomobile/redis';
</script>

README

npm last build PRs Welcome

@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.