Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moaxaca/async-redis
First class async & promise support for redis.
https://github.com/moaxaca/async-redis
async async-redis database node-redis nodejs promise-support redis
Last synced: 4 days ago
JSON representation
First class async & promise support for redis.
- Host: GitHub
- URL: https://github.com/moaxaca/async-redis
- Owner: moaxaca
- License: other
- Created: 2017-03-24T04:20:08.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T19:53:41.000Z (about 2 years ago)
- Last Synced: 2024-10-29T23:19:23.120Z (4 months ago)
- Topics: async, async-redis, database, node-redis, nodejs, promise-support, redis
- Language: JavaScript
- Homepage:
- Size: 425 KB
- Stars: 168
- Watchers: 7
- Forks: 21
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Async Redis
===========================
[](https://github.com/moaxaca/async-redis/actions/workflows/ci.yaml)
[](https://www.npmjs.com/package/async-redis)
[](https://www.npmjs.com/package/async-redis)
[](https://github.com/moaxaca/async-redis/blob/master/LICENSE)
[](https://coveralls.io/github/moaxaca/async-redis)
[](https://codeclimate.com/github/moaxaca/async-redis/maintainability)
[](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