需要被模块化的函数的格式(有多种,这只记录一种):
‘use strict’; ##以严格模式运行JavaScript代码,避免各种潜在陷阱
module.exports = {
hello: function () { return console.log(“hello word”); }
word: function() { return console.log(“hello word”);}
};##模块化
其他地方调用:
‘use strict’;
var ex = require(“./hello”)
ex.hello()