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

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.3.0 to 0.4.0

test/files/tr_sh/node_modules/g/tr_g.js

37

index.js

@@ -124,4 +124,3 @@ var fs = require('fs');

function makeTransform (file, tr) {
if (/\s/.test(tr)) return cmdTransform(file, tr);
if (typeof tr === 'function') return tr(file);
var tout = through(), tin = through();

@@ -133,6 +132,7 @@ tin.pause();

if (err) return output.emit('error', err);
var t = res
? require(res)(file)
: cmdTransform(file, tr)
;
if (!res) return output.emit('error', [
'cannot find transform module ', tr,
' while transforming ', file
].join(''));
var t = require(res)(file);
t.pipe(tout);

@@ -144,27 +144,2 @@ tin.pipe(t);

}
function cmdTransform (file, tr) {
var cmd = parseShell(tr);
var env = Object.create(process.env);
env._ = tr;
env.FILENAME = file;
var current = { id: file, filename: file, paths: [] };
var ps = spawn(cmd[0], cmd.slice(1), {
cwd: path.dirname(file),
env: env
});
var error = '';
ps.stderr.on('data', function (buf) { error += buf });
ps.on('close', function (code) {
if (code !== 0) {
return output.emit('error', [
'process ' + tr + ' exited with code ' + code,
' while parsing ' + file + '\n',
error.split('\n').join('\n ')
].join(''));
}
});
return duplexer(ps.stdin, ps.stdout);
}
};
{
"name": "module-deps",
"version": "0.3.0",
"version": "0.4.0",
"description": "walk the dependency graph to generate json output that can be fed into browser-pack",

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

{
"main": "index.js",
"browserify": {
"transform": "sed s/GGG/111/g"
"transform": "./tr_g.js"
}
}

@@ -9,3 +9,3 @@ var mdeps = require('../');

var p = mdeps(__dirname + '/files/tr_sh/main.js', {
transform: [ 'sed s/AAA/5/', 'sed s/BBB/50/' ],
transform: [ './tr_a.js', './tr_b.js' ],
transformKey: [ 'browserify', 'transform' ]

@@ -12,0 +12,0 @@ });

Sorry, the diff of this file is not supported yet

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