require-list
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -13,2 +13,16 @@ /** | ||
var DYNAMIC_LOADING = 'Dynamic loading'; | ||
var COLOR = { | ||
BLACK: '\u001b[30m', | ||
RED: '\u001b[31m', | ||
GREEN: '\u001b[32m', | ||
YELLOW: '\u001b[33m', | ||
BLUE: '\u001b[34m', | ||
MAGENTA: '\u001b[35m', | ||
CYAN: '\u001b[36m', | ||
WHITE: '\u001b[37m', | ||
RESET: '\u001b[0m' | ||
}; | ||
function findRequire(est) { | ||
@@ -21,3 +35,7 @@ if (est.type === esprima.Syntax.CallExpression && | ||
return [ est.arguments[0].value ]; | ||
if (est.arguments[0].type === esprima.Syntax.Literal) { | ||
return [ est.arguments[0].value ]; | ||
} else { | ||
return [ DYNAMIC_LOADING ]; | ||
} | ||
} | ||
@@ -82,5 +100,14 @@ | ||
for (key in childs) { | ||
if (key === DYNAMIC_LOADING) { | ||
if (color) { | ||
str += indent + COLOR.YELLOW + key + COLOR.RESET + '\n'; | ||
} else { | ||
str += indent + key + '\n'; | ||
} | ||
continue; | ||
} | ||
if (/^\w/.test(key)) { | ||
if (color) { | ||
str += indent + '\u001b[35m' + key + '\u001b[0m\n'; | ||
str += indent + COLOR.MAGENTA + key + COLOR.RESET + '\n'; | ||
} else { | ||
@@ -96,3 +123,3 @@ str += indent + key + '\n'; | ||
} else if (color) { | ||
str += indent + '\u001b[32m' + path.relative(dirname, key) + '\u001b[0m\n'; | ||
str += indent + COLOR.GREEN + path.relative(dirname, key) + COLOR.RESET + '\n'; | ||
} else { | ||
@@ -99,0 +126,0 @@ str += indent + path.relative(dirname, key) + '\n'; |
{ | ||
"name": "require-list", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "require tree list", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14750
185
0