node.js - how to check with ioredis if the a connection was established to the redis server? -


i'm writing nodejs 5.10.1 application, , connect redis-server.

i'm using ioredis nodejs module https://github.com/luin/ioredis.

i can't seem figure out how check if connection established server.

the code connect redis server pretty simple:

var redis = require('ioredis'); var redis = new redis(); 

the documentation states following under connection events

you can check out redis#status property current connection status. 

don't understand means or how work it. ideas ?

one of properties of redis object started status:

console.log(redis.status) give current , in case says : connecting


Comments