合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
在Node中,每个模块内部都有一个自己的module对象, 该module对象中,有一个成员叫:exports 也就是说如果你需要对外导出成员,只需要把导出的对象挂载到exports对象上 ``` var module = { exports: { foo: 'bar', add: function(x, y) { return x + y; } } } ``` 也就是说在模块中还有这么一句代码 var exports = module.exports; console.log(exports === module.exports); //true