标签:nod .sh exp span require exports func node.js var
(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
node.js exports module.exports
标签:nod .sh exp span require exports func node.js var
原文地址:http://www.cnblogs.com/jkklearn/p/7395827.html