Socket
Socket
Sign inDemoInstall

spawn-wrap

Package Overview
Dependencies
23
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.3 to 1.2.4

test/fixtures/node_modules/npm/bin/npm-cli.js

4

index.js

@@ -122,3 +122,5 @@ module.exports = wrap

if (cmdi !== -1) {
options.args[cmdi + 1] = winRebase(options.args[cmdi + 1], workingDir + '/node.cmd')
options.args[cmdi + 1] = winRebase(options.args[cmdi + 1],
workingDir + '/node.cmd',
whichOrUndefined)
}

@@ -125,0 +127,0 @@ } else if (file === 'node' || file === 'iojs' || cmdname === file) {

var re = /^\s*("*)([^"]*?\b(?:node|iojs)(?:\.exe)?)("*)( |$)/
var npmre = /^\s*("*)([^"]*?\b(?:npm))("*)( |$)/
var path_ = require('path')
if (path_.win32) path_ = path_.win32
module.exports = function (path, rebase) {
module.exports = function (path, rebase, whichOrUndefined) {
var m = path.match(re)
if (!m) return path
if (!m) {
m = path.match(npmre)
if (!m) return path
var npmPath = whichOrUndefined('npm') || 'npm'
npmPath = path_.dirname(npmPath) + '\\node_modules\\npm\\bin\\npm-cli.js'
return path.replace(npmre, m[1] + rebase + ' "' + npmPath + '"' + m[3] + m[4])
}
// preserve the quotes

@@ -7,0 +16,0 @@ var replace = m[1] + rebase + m[3] + m[4]

{
"name": "spawn-wrap",
"version": "1.2.3",
"version": "1.2.4",
"description": "Wrap all spawned Node.js child processes by adding environs and arguments ahead of the main JavaScript file argument.",

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

@@ -33,1 +33,9 @@ var t = require('tap')

})
t.test('handles npm invocations', function (t) {
var result = winRebase('""npm" "install""',
'C:\\foo',
function() { return 'C:\\path-to-npm\\npm' })
t.equal(result, '""C:\\foo "C:\\path-to-npm\\node_modules\\npm\\bin\\npm-cli.js"" "install""')
t.end()
})

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc