另一种方式(左边不用定义名字)
module.exports=add
b.js
console.log('this is b.js');
exports.readFile=function(){
console.log('my readfile in b.js');
}
c.js
var bExport=require('./b.js');
bExport.readFile();
node c.js
另一种方式(左边不用定义名字)
module.exports=add
b.js
console.log('this is b.js');
exports.readFile=function(){
console.log('my readfile in b.js');
}
c.js
var bExport=require('./b.js');
bExport.readFile();
node c.js