1

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 = {}
Derek 朕會功夫
  • 88,688
  • 41
  • 174
  • 241
Manu Chadha
  • 13,750
  • 13
  • 62
  • 153

0 Answers0