nodebeginner.org icon indicating copy to clipboard operation
nodebeginner.org copied to clipboard

Explain the 'export' object

Open danielbachhuber opened this issue 11 years ago • 2 comments

In the section where server.js is turned into a node module, the following is introduced:

exports.start = start;

It would be nice if the exports object was introduced. It's not entirely clear what it does, other than "it just works."

danielbachhuber avatar Dec 08 '12 18:12 danielbachhuber

Actually here functions are exported so that other controller's can take advantages of those functions,

instead of writing 'exports.start = start' we can also do this 'export function start'

kunal8411 avatar Apr 01 '23 07:04 kunal8411

Please let me know do you need any code change for this.

kunal8411 avatar Apr 01 '23 07:04 kunal8411