ERROR: No README.md file found!
for lazy people who don't want to spend more than one line connecting to their redis DB. Don't forget to depend on redis, too. We don't ship it because locking the version in redis-connector is silly.
There are two types of conf objects:
- If it has a .get method, it will be called with
'redis:pass'to get the respective values. This is most useful with nconf.
- Otherwise, its
It authenticates if necessary and calls your callback with the db object. As a convenience, it also returns the db object.
If an error occurs, we won't catch it. It is assumed that the db is essential for your app to work and that starting without it is thus useless.
Connect to a db using a plain object for configuration and using the return value to get the db object.
var db = require'redis-connector''host': 'ray.redistogo.com''port': 1234'pass': 'banana'dbConnected;//do stuff with db!
You can also take the db in the callback
require'redis-connector''host': 'ray.redistogo.com''port': 1234'pass': 'banana'doDbStuff;//do stuff with db!
And of course, you can do both.