Skip to content
This repository has been archived by the owner on Jan 10, 2019. It is now read-only.

add .open() method #29

Open
avetisk opened this issue Feb 28, 2013 · 0 comments
Open

add .open() method #29

avetisk opened this issue Feb 28, 2013 · 0 comments

Comments

@avetisk
Copy link

avetisk commented Feb 28, 2013

Something like in MongooseJS (please see examples given in the linked page):

// lib/thoonk.js
module.export = require('thoonk').createClient();
// config/dev.js
...
require('../lib/pubsub.js').open('localhost', '6379', 'dev');
...

// config/prod.js
...
require('../lib/pubsub.js').open('prod.server', '6379', 'prod');
...

And then, whenever we need thoonk, we can get it, fully ready just by requiring it:

// app.js
...
require('./config/' + process.env.NODE_ENV + '.js');

var thoonk = require('./lib/thoonk.js'); // ready-to-use!
...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant