# async-redis

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

Latest version **2.0.0** (published 2021-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install async-redis
pnpm add async-redis
yarn add async-redis
bun add async-redis
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-05-25 |
| First published | 2017-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=7.6.0 |
| Dependencies | 1 |
| Unpacked size | 34.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 168 |
| Author | Matthew Oaxaca |
| Maintainers | moaxaca |
| Keywords | redis, async, promise, es6 |

## Links

- npm: https://www.npmjs.com/package/async-redis
- Repository: https://github.com/moaxaca/async-redis
- Issues: https://github.com/moaxaca/async-redis/issues
- npm.io page: https://npm.io/package/async-redis

## Dependencies (1)

- [redis](https://npm.io/package/redis.md) 3.1.2

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2021-05-25
- 1.1.7 — 2019-02-14
- 1.1.5 — 2019-01-14
- 1.1.4 — 2018-04-05
- 1.1.3 — 2018-03-13
- 1.1.2 — 2018-02-16
- 1.1.1 — 2018-02-14
- 1.1.0 — 2018-02-14
- 1.0.0 — 2017-03-30

## README

Async Redis
===========================
[![Build Status](https://travis-ci.org/moaxaca/async-redis.svg?branch=master)](https://travis-ci.org/moaxaca/async-redis)
[![npm](https://img.shields.io/npm/v/async-redis.svg)](https://www.npmjs.com/package/async-redis)
[![npm](https://img.shields.io/npm/dm/async-redis.svg)](https://www.npmjs.com/package/async-redis)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/moaxaca/async-redis/blob/master/LICENSE)
[![Coverage Status](https://coveralls.io/repos/github/moaxaca/async-redis/badge.svg)](https://coveralls.io/github/moaxaca/async-redis)
[![Maintainability](https://api.codeclimate.com/v1/badges/141c7e0d80d10b10c42a/maintainability)](https://codeclimate.com/github/moaxaca/async-redis/maintainability)
[![Known Vulnerabilities](https://snyk.io/test/github/moaxaca/async-redis/badge.svg?targetFile=package.json)](https://snyk.io/test/github/moaxaca/async-redis?targetFile=package.json)

Light weight wrapper over the [node_redis](https://github.com/NodeRedis/node_redis) library with first class async & promise support. 

## Installation
To install the stable version:
``` 
npm install --save async-redis
```

## Usage Example

### Creating Connection
```js
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
```js
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](http://redis.js.org). 

## License
MIT

---
_Source: https://npm.io/package/async-redis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
