in one file (otherFile.js) I have this:
exports = function() {}
in my main file I have this:
var thing = require(\'./otherFile.
Consider this code:
!function(exports) {
// your module code
exports = 12345
}(module.exports)
console.log(module.exports)
It won't work, and it's easy to see why. Node.js exports object is defined exactly like this, with an exception of arguments ordering.
So always use module.exports instead of exports, it'll do the right thing.