exports 和 module.exports 的区别

来源:互联网 发布:新浪网的域名和ip地址 编辑:程序博客网 时间:2024/06/03 15:20

require() 返回的是 module.exports 而不是 exports,

exports只不过是它的一个辅助工具。

所有的exports收集到的属性和方法,都赋值给了Module.exports


把下面两篇文章理解了  也就理解 exports 和 module.exports 的联系

1.http://cnodejs.org/topic/5231a630101e574521e45ef8

2.http://www.cnblogs.com/pigtail/archive/2013/01/14/2859555.html

原创粉丝点击