Answers for "node-redis"



// node-redis to promise, because node-redis not support promise

import bluebird from 'bluebird'
import { Commands, createClient } from 'redis'

const client = createClient({
	host: process.env.REDIS_HOST,
	port: parseInt(process.env.REDIS_PORT),
	password: process.env.REDIS_PASSWORD

let redisCon: Commands<any>
;(async (redis) => {
	const redisPromise = await bluebird.resolve<Commands<any>>(redis)
	redisCon = redisPromise

export { redisCon }
Posted by: Guest on April-21-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language