I have seen two types of exports. Is there a difference between them? Is one style better than the other?
function start(route,handle) {
}
Style 1
exports.start = start;
style 2
module.exports = start
I suppose that they are the same as somewhere in there is a mapping between exports
and module.exports
. So is there a purpose to have these two styles?
exports = module.exports = {}