Created
June 3, 2020 03:04
-
-
Save nkreiger/20a3a05b41a4b0d55248d41fd175c97b to your computer and use it in GitHub Desktop.
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
const client = require('redis').createClient(); | |
const { promisify } = require("util"); | |
client.on('connect', () => { | |
console.log('Redis client connected'); | |
}); | |
client.on("error", (error) => { | |
console.error(error); | |
}); | |
const get = promisify(client.get).bind(client); | |
const set = promisify(client.set).bind(client); | |
const getList = promisify(client.lrange).bind(client); | |
module.exports = { | |
get, | |
set, | |
getList | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment