Created
December 2, 2017 19:13
-
-
Save cmmartin/1df1357434204521a672eb0bb571c3aa to your computer and use it in GitHub Desktop.
Redis client for node.js that uses promises
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
import redis from 'redis' | |
import bluebird from 'bluebird' | |
bluebird.promisifyAll(redis.RedisClient.prototype) | |
bluebird.promisifyAll(redis.Multi.prototype) | |
const client = redis.createClient(process.env.REDIS_URL) | |
client.on('error', err => console.log(err)) // eslint-disable-line no-console | |
export default client |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment