Skip to content

Instantly share code, notes, and snippets.

@CalvinRodo
Created February 3, 2013 13:48
Show Gist options
  • Save CalvinRodo/4701852 to your computer and use it in GitHub Desktop.
Save CalvinRodo/4701852 to your computer and use it in GitHub Desktop.
Parent object
var DB = function DB() {
}
DB.prototype = {
ConnectToDb: function () {
var mongoDb = require('mongoskin'),
settings = require('../express_settings.js');
return mongoDb.db(settings.Config.MongoDbConnection);
}
}
exports.DB = DB;
@jonathanong
Copy link

that first var is completely unnecessary

consider doing module.exports = DB instead, but that's unrelated to your problem

might as well post everything here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment