promise-redis-ejs

1.0.2 • Public • Published

promise-redis-ejs

promise-redis-ejs is a modern (>= 8.x) fork of promise-redis which makes node_redis return Promises.

It uses native Promise objects and util.promisify for promisifacation, but allows providing an alternative client for use with fakeredis

Installation

npm install promise-redis

Normal Usage

const PromiseRedis = require('promise-redis-ejs');
const Redis = PromiseRedis();
const client = Redis.createClient();
 
client.keys('*').then((keys) => {
  console.log(keys);
});

Using FakeRedis for testing

const FakeRedis = require('fakeredis');
const PromiseRedis = require('promise-redis-ejs');
const client = PromiseRedis(FakeRedis).createClient();
 
client.set('x', 'y').then(async () => {
  var keys = await client.keys('*');
  console.log(keys); // ['x']
})

Readme

Keywords

Package Sidebar

Install

npm i promise-redis-ejs

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • richthegeek