You could write a wrapper, a new module where you store the db instance, something similar to this:
//db.js
var HOSTNAME = ...
var PORT = ...
var db = module.exports = {};
var instance;
db.connect = function (){
...
instance = <db_instance>;
};
db.disconnect = function (){
...
instance = null;
};
db.instance = function (){
return instance;
};
Now, every time you need the db instance retrieve it by doing:
var db = require ("./path/to/db");
db.instance ();