标签:class nod function turn www 引用 name func cti
/*User.js*/ exports.userName = ‘Tom‘; exports.sayHello = function () { return ‘wwwwww‘ } /*或者*/ module .exports = { userName:"jack", sayHello: function () { return ‘Hello‘; } } /*引用*/ let user = require(‘./User‘); console.log(`userName:${user.userName}`) console.log(`i‘m ${user.userName},I say ${user.sayHello()}`)
Node.js的学习入门(一、module.exports与exports)
标签:class nod function turn www 引用 name func cti
原文地址:http://www.cnblogs.com/zhoujx1066/p/7776853.html