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.2 to 0.1.3

17

lib/index.js

@@ -11,3 +11,4 @@ /**

var esprima = require('esprima');
var escodegen = require('escodegen'),
esprima = require('esprima');

@@ -38,3 +39,3 @@ var DYNAMIC_LOADING = 'Dynamic loading';

} else {
return [ DYNAMIC_LOADING ];
return [ DYNAMIC_LOADING + '_' + escodegen.generate(est) ];
}

@@ -72,5 +73,12 @@ }

var childs = findRequire(est);
var i = 0, len = childs.length, child;
var i = 0, len = childs.length, child, dcnt = 0;
for (i; i < len; i++) {
child = childs[i];
if (child.indexOf(DYNAMIC_LOADING + '_') === 0) {
// dynamic loading
result[DYNAMIC_LOADING + '_' + dcnt] = child.replace(DYNAMIC_LOADING + '_', '');
dcnt++;
continue;
}
if (/^\w/.test(child)) {

@@ -106,3 +114,4 @@ // core module

if (key === DYNAMIC_LOADING) {
if (key.indexOf(DYNAMIC_LOADING) === 0) {
key = DYNAMIC_LOADING + ' code=> ' + childs[key];
if (color) {

@@ -109,0 +118,0 @@ str += curr_indent + COLOR.YELLOW + key + COLOR.RESET + '\n';

{
"name": "require-list",
"version": "0.1.2",
"version": "0.1.3",
"description": "require tree list",

@@ -33,2 +33,3 @@ "main": "index.js",

"dependencies": {
"escodegen": "^1.6.1",
"esprima": "^1.2.5"

@@ -35,0 +36,0 @@ },

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