一、目录结构

二、调用方法
(1)方法一
hello.js
function world(txt) {
console.log(txt);
}
module.exports = world;
Test.js
var world = require('./hello');
world("hello world");
(2)方法二
hello.js
exports.world = function(txt) {
console.log(txt);
}
Test.js
var hello = require('./hello');
hello.world("hello world");