区别关于二者的关系,你只需要这4点: exports 只是 module.exports 的引用,也就是后者的偷懒写法而已,所以,绝大部分情况下,二者没有区别!require() 返回的是 module.exports 而不是 exports一旦你给exports重新赋值,它将不再是module.exports的引用,所以无法正常导出;虽然module.exports默认值为一个空对象{}(... 阅读全文
@2016-11-02
Node.js
浏览(3108)