Gabe if you module.expoerts = {} you can use that objects methods and properties whereever you require it?
Mike
// foo.js
module.exports = {
baz: 'hi'
};
// bar.js
var foo = require('./foo.js');
foo.baz === 'hi';
That's the commonjs spec
Gabe and what about module.exports = function() {}
Mike node does a little bit extra exactly commonjs wouldn't let you but node will
// foo.js
module.exports = function () {
return 'hi';
};
// bar.js
var foo = require('./foo.js');
foo() === 'hi';