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.5 to 0.1.6

16

lib/index.js

@@ -62,6 +62,8 @@ /**

* @param {Number} depth
* @param {Object} checkModule
* @returns {Object}
*/
function childTree(filepath, depth) {
function childTree(filepath, depth, checkModule) {
depth = depth || 0;
checkModule = checkModule || {};
if (depth > 10) {

@@ -104,2 +106,3 @@ return {};

child = require.resolve(path.resolve(path.dirname(filepath), child));
if (path.extname(child) !== '.js') {

@@ -109,3 +112,10 @@ result[child] = null;

}
result[child] = childTree(child, depth + 1);
if (checkModule[child]) {
result[child] = {};
continue;
}
checkModule[child] = true;
result[child] = childTree(child, depth + 1, checkModule);
}

@@ -214,3 +224,3 @@

var str = entrypoint + '\n';
return convertString(path.dirname(entrypoint), color, str, tree);
return convertString(path.dirname(entrypoint), color, str, tree, '', {}, [ entrypoint ]);
};

2

package.json
{
"name": "require-list",
"version": "0.1.5",
"version": "0.1.6",
"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