根据您评论,我将执行以下操作:
module.exports = function (app, db) { var module = {}; module.auth = function (req, res) { // This will be available 'outside'. // Authy stuff that can be used outside... }; // Other stuff... module.pickle = function(cucumber, herbs, vinegar) { // This will be available 'outside'. // Pickling stuff... }; function jarThemPickles(pickle, jar) { // This will be NOT available 'outside'. // Pickling stuff... return pickleJar; }; return module;};我几乎像这样构造了我所有的模块。似乎对我来说很好。



