Skip to content

Instantly share code, notes, and snippets.

@stagas stagas/reexport.js
Created Jan 13, 2013

What would you like to do?
example passing deps around with exports.
// common.js = 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
You can’t perform that action at this time.