node.js中module.exports和exports的区别

来源:互联网 发布:照片时间轴软件 编辑:程序博客网 时间:2024/05/17 18:04

exports 和 module.exports 的区别:

  1. module.exports 初始值为一个空对象 {}
  2. exports 是指向的 module.exports 的引用
  3. require() 返回的是 module.exports 而不是 exports
原创粉丝点击