1、require载入依赖 var http = require('http');//http为路径,可以忽略后缀 2、exports输出依赖 exports.add=add;//add为方法 3、只需要在载入依赖的页面引用方法就可以 相关文章: