nodebeginner.org
nodebeginner.org copied to clipboard
Explain the 'export' object
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."
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'
Please let me know do you need any code change for this.