async-redis

Light wrapper over redis_node with first class async & promise support.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
async-redis
168132.0.03 years ago7 years agoMinified + gzip package size for async-redis in KB

Readme

Async Redis
Build Status npm npm license Coverage Status Maintainability Known Vulnerabilities
Light weight wrapper over the noderedis library with first class async & promise support.

Installation

To install the stable version:
npm install --save async-redis

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 noderedis. It simply appends a promise resolving/rejecting callback for every command.
For information on redis commands and configuration visit node
redis docs.

License

MIT