Skip to content

Instantly share code, notes, and snippets.

@cmmartin
Created December 2, 2017 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmmartin/1df1357434204521a672eb0bb571c3aa to your computer and use it in GitHub Desktop.
Save cmmartin/1df1357434204521a672eb0bb571c3aa to your computer and use it in GitHub Desktop.
Redis client for node.js that uses promises
/* @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