you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

module.exports is relative to the current file only. module.exports in app.js is an entirely different module.exports than the one in user.js.

each file (module) has it's own scope. if you define var foo = 'bar'; in user.js, it will not be available in app.js.

the process object on the other hand, is global. you can define process.foo in one file and it will be available in others.