关于NodeJs模块调用
1、fun.js
function Say() {
var name;
this.setName = function(username) {
name = username;
};
this.sayHello = function() {
console.log(‘hi, ‘ + name);
};
};
module.exports = Say;
2、demo.js
var Say = require(‘./func’);
say = ne