batch-import
Advanced tools
Comparing version
10
index.js
@@ -16,4 +16,3 @@ 'use strict'; | ||
modules[name] = {} | ||
recursion(`${cwd}/${option.path}`, option.exclude, modules[name]) | ||
recursion(`${cwd}/${option.path}`, option, modules[name]) | ||
} | ||
@@ -48,2 +47,9 @@ | ||
if (option.contain) { | ||
if (option.contain.indexOf(itemPath) === -1) { | ||
console.log(itemPath) | ||
return | ||
} | ||
} | ||
let filename = itemPath.slice(0, key) | ||
@@ -50,0 +56,0 @@ let completePath = path + itemPath |
{ | ||
"name": "batch-import", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "批量加载node.js模块、目录,并转换为对应的JS对象", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,2 +8,3 @@ "use strict" | ||
"path": "./controllers/", | ||
"contain": ["_route.js"], | ||
"exclude": ['./c1/'], | ||
@@ -10,0 +11,0 @@ }, |
2675
9.63%72
12.5%