(make.js)
function show(data){ console.log("WEILCOME" + data); } exports.show = show
获取
var show = require("./make").show;
show("jinkang");
输出 WELCOME jinkang
(make.js)
exports.show = function(data){ console.log("WEILCOME" + data); }
获取
var show = require("./make").show;
show("jinkang");
输出 WELCOME jinkang
(make.js)
module.exports = function(data){ console.log("WEILCOME" + data); }
获取
var show = require("./make");
show("jinkang");
输出 WELCOM jinkang