1.0.2 • Published 7 years ago
han-egg-utils v1.0.2
han-egg-utils 封装常用工具类。
version : 1.0.0 update by 2017-04-16
method list : 1. loadir by path HCommonUtils.loadDir(dir);
demo :
module/a.js : module.exports = function () { console.log('module a'); }
module/b.js : module.exports = function () { console.log('module b'); } module/hello/b.js : module.exports = function () { console.log('module b--hello'); }
use: var CommonUtils = require('han-egg-utils');
var Module = CommonUtils.loadDir(dirname+'/test'); var ModuleHello = CommonUtils.loadDir(dirname+'/test/hello');
Module.a(); // print module a Module.b(); // print module b ModuleHello.b(); //print module b--hello