1.2.3 • Published 3 years ago

@remikalbe/async-redis v1.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Async Redis

Build Status npm npm license

Light weight wrapper over the node_redis library with first class async & promise support.

Why this fork?

async-redis seems to be dead and has obsolete redis and redis-command dependencies (it still require hiredis) which is a big issue for my use case.

Installation

To install the stable version:

npm install --save @remikalbe/async-redis

Typescript Support

npm install --save-dev @types/async-redis

types

Usage Example

Creating Connection

const asyncRedis = require("async-redis");
const client = asyncRedis.createClient();

client.on("error", function (err) {
  console.log("Error " + err);
});

const asyncBlock = async () => {
  await client.set("string key", "string val");
  const value = await client.get("string key");
  console.log(value);
  await client.flushall("string key");
};

Decorating Existing Connections

const redis = require("redis");
const client = redis.createClient();
const asyncRedis = require("async-redis");
const asyncRedisClient = asyncRedis.decorate(client);

API Information

This library does very little modification to the api of node_redis. It simply appends a promise resolving/rejecting callback for every command.

For information on redis commands and configuration visit node_redis docs.

License

MIT

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago