Skip to content

Instantly share code, notes, and snippets.

@stagas
Created January 13, 2013 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stagas/4524779 to your computer and use it in GitHub Desktop.
Save stagas/4524779 to your computer and use it in GitHub Desktop.
example passing deps around with exports.
// common.js
exports.app = require('./app')
exports.db = require('./db')
// app.js
var common = require('./common')
var db = common.db
var app = module.exports = express()
// db.js
var app = require('./common').app
var db = module.exports = new Database(app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment