标签:code color require pre logs fun student blog exp
student.js
exports.add = function(){...}
var student = require(‘./student.js‘)
student.add(‘John‘)
student.js 代码如下:
function add(student){ console.log(‘Add student:‘+student); } exports.add = add; // 将add方法暴露出去
标签:code color require pre logs fun student blog exp
原文地址:http://www.cnblogs.com/cuimm/p/7815309.html