0

i am new to express framework. I need to understand the differences between "module.exports" and "exports" ?

Mahesh Singh Chouhan
  • 2,558
  • 1
  • 16
  • 26
  • 2
    Possible duplicate of [What do "module.exports" and "exports.methods" mean in NodeJS / Express?](http://stackoverflow.com/questions/6116960/what-do-module-exports-and-exports-methods-mean-in-nodejs-express) – Matt Feb 15 '16 at 20:02

1 Answers1

1

exports and module.exports reference the same object. Exports is a variable that lives on module.exports. module.exports encapsulates related code into a single unit of code i.e. any methods or variable defined inside the module.exports can be available in other files. Have a look to this for more clarity more on module.exports

Community
  • 1
  • 1