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

tinyspawn

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinyspawn - npm Package Compare versions

Comparing version 1.2.13 to 1.2.14

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/microlinkhq/tinyspawn",
"version": "1.2.13",
"version": "1.2.14",
"main": "src/index.js",

@@ -8,0 +8,0 @@ "author": {

@@ -6,5 +6,3 @@ 'use strict'

const EE_PROPS = Object.getOwnPropertyNames(
require('events').EventEmitter.prototype
)
const EE_PROPS = Object.getOwnPropertyNames(require('events').EventEmitter.prototype)
.filter(name => !name.startsWith('_'))

@@ -14,6 +12,22 @@ .concat(['kill', 'ref', 'unref'])

const eos = (stream, listener, buffer = []) =>
stream[listener]
? stream[listener].on('data', data => buffer.push(data)) && buffer
: buffer
stream[listener] ? stream[listener].on('data', data => buffer.push(data)) && buffer : buffer
const createChildProcessError = ({ cmd, cmdArgs, exitCode, stderr, childProcess }) => {
const command = `${cmd} ${cmdArgs.join(' ')}`
let message = `The command spawned as:${EOL}${EOL}`
message += ` ${command}${EOL}${EOL}`
message += `exited with \`{ code: ${exitCode} }\` and the following trace:${EOL}${EOL}`
message += String(stderr)
.split(EOL)
.map(line => ` ${line}`)
.join(EOL)
const error = new Error(message)
error.command = command
error.name = 'ChildProcessError'
Object.keys(childProcess).forEach(key => {
error[key] = childProcess[key]
})
return error
}
const clean = str => str.trim().replace(/\n$/, '')

@@ -47,18 +61,5 @@

Object.defineProperty(childProcess, 'stderr', { get: parse(stderr) })
if (exitCode === 0) return resolve(childProcess)
const command = `${cmd} ${cmdArgs.join(' ')}`
let message = `The command spawned as:${EOL}${EOL}`
message += ` ${command}${EOL}${EOL}`
message += `exited with \`{ code: ${exitCode} }\` and the following trace:${EOL}${EOL}`
message += String(stderr)
.split(EOL)
.map(line => ` ${line}`)
.join(EOL)
const error = new Error(message)
error.command = command
error.name = 'ChildProcessError'
Object.keys(childProcess).forEach(key => {
error[key] = childProcess[key]
})
reject(error)
return exitCode === 0
? resolve(childProcess)
: reject(createChildProcessError({ cmd, cmdArgs, exitCode, stderr, childProcess }))
})

@@ -69,5 +70,3 @@ })

if (childProcess) {
EE_PROPS.forEach(
name => (subprocess[name] = childProcess[name].bind(childProcess))
)
EE_PROPS.forEach(name => (subprocess[name] = childProcess[name].bind(childProcess)))
}

@@ -74,0 +73,0 @@ return subprocess

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