Socket
Socket
Sign inDemoInstall

module-deps

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

module-deps - npm Package Compare versions

Comparing version 0.11.0 to 0.11.1

28

index.js

@@ -16,4 +16,10 @@ var fs = require('fs');

if (!Array.isArray(mains)) mains = [ mains ].filter(Boolean);
mains = mains.map(function (file) {
return typeof file === 'object' ? file : path.resolve(file);
var basedir = opts.basedir || process.cwd();
var entries = mains.map(function (file) {
if (file && typeof file.pipe === 'function') {
var n = Math.floor(Math.pow(16,8) * Math.random()).toString(16);
return path.join(basedir, 'fake_' + n + '.js');
}
return path.resolve(file);
});

@@ -30,3 +36,8 @@

var top = { id: '/', filename: '/', paths: [] };
mains.forEach(function (main) { walk(main, top) });
mains.forEach(function (main, ix) {
if (typeof main === 'object') {
walk({ stream: main, file: entries[ix] }, top);
}
else walk(main, top)
});

@@ -44,7 +55,4 @@ if (mains.length === 0) {

if (id && typeof id === 'object' && typeof id.pipe === 'function') {
return id.pipe(concat(function (src) {
var n = Math.floor(Math.pow(16,8) * Math.random()).toString(16);
var basedir = opts.basedir || process.cwd();
var file = path.join(basedir, 'fake_' + n + '.js');
if (typeof id === 'object') {
return id.stream.pipe(concat(function (src) {
var pkgfile = path.join(basedir, 'package.json');

@@ -58,3 +66,3 @@ fs.readFile(pkgfile, function (err, pkgsrc) {

var trx = getTransform(pkg);
applyTransforms(file, trx, src, pkg);
applyTransforms(id.file, trx, src, pkg);
});

@@ -184,3 +192,3 @@ }));

};
if (mains.indexOf(file) >= 0) {
if (entries.indexOf(file) >= 0) {
rec.entry = true;

@@ -187,0 +195,0 @@ }

{
"name": "module-deps",
"version": "0.11.0",
"version": "0.11.1",
"description": "walk the dependency graph to generate json output that can be fed into browser-pack",

@@ -12,3 +12,3 @@ "main": "index.js",

"JSONStream": "~0.6.4",
"browser-resolve": "git://github.com/substack/node-browser-resolve.git#dir-replace",
"browser-resolve": "~1.1.0",
"resolve": "~0.4.0",

@@ -15,0 +15,0 @@ "detective": "~2.1.2",

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