• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Whokay 必ず勝つ!頑張ろう!
博客园    首页    新随笔    联系   管理    订阅  订阅
2013年11月24日
nodejs 中 module.exports 和 exports 的区别
摘要: 1. module应该是require方法中,上下文中的对象2. exports对象应该是上下文中引用module.exports的新对象3. exports.a = xxx 会将修改更新到module.exports对象中4. exports = xxx 直接改变了 exports的指向,module.js的474行代码:module._compile(stripBOM(content), filename);module.js的437行代码:var wrapper = Module.wrap(content);再往下跟:进入node.js文件的879行:return NativeModul 阅读全文
posted @ 2013-11-24 14:16 Vince 阅读(3569) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3