模块的引用是后端语言非常重要的一部分,那么在nodejs中,如何做到这一点呢. 在引用其他模块时,常用的就是两种方法:exports,module.exports. 接下来,我们写一个demo来分辨其中的区别 testModule.js: function User(name,title,post){ this.name=name; this.title=title; this.post=post; } User.prototype.sayhello = function() { console