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 朕會功夫
  • 92,235
  • 44
  • 185
  • 247
Manu Chadha
  • 15,555
  • 19
  • 91
  • 184

0 Answers0