Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

require-list

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-list - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

33

lib/index.js

@@ -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';

2

package.json
{
"name": "require-list",
"version": "0.1.0",
"version": "0.1.1",
"description": "require tree list",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc