Skip to content

Instantly share code, notes, and snippets.

@sunnycmf
Last active March 17, 2016 09:04
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 sunnycmf/8928804 to your computer and use it in GitHub Desktop.
Save sunnycmf/8928804 to your computer and use it in GitHub Desktop.
whats' the different between module.export VS exports.<method_name>
var ErrorLog = common.mongoose.model('ErrorLog', schema);
// differences of line 4 vs 5?
exports = module.exports = ErrorLog;
exports.ErrorLog = ErrorLog;
@JasterTDC
Copy link

I think exports = module.exports = ErrorLog; exports and object and the line 5 exports only the method ErrorLog.

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