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

teen_process

Package Overview
Dependencies
Maintainers
8
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

teen_process - npm Package Compare versions

Comparing version 1.14.3 to 1.15.0

69

build/lib/exec.js

@@ -21,2 +21,4 @@ "use strict";

const MAX_BUFFER_SIZE = 100 * 1024 * 1024;
async function exec(cmd, args = [], opts = {}) {

@@ -34,3 +36,5 @@ const rep = (0, _shellQuote.quote)([cmd, ...args]);

shell: undefined,
logger: undefined
logger: undefined,
maxStdoutBufferSize: MAX_BUFFER_SIZE,
maxStderrBufferSize: MAX_BUFFER_SIZE
}, opts);

@@ -62,34 +66,45 @@ return await new _bluebird.default((resolve, reject) => {

if (proc.stdout) {
proc.stdout.on('error', err => {
reject(new Error(`Standard output '${err.syscall}' error: ${err.stack}`));
const handleStream = (streamType, streamProps) => {
if (!proc[streamType]) {
return;
}
proc[streamType].on('error', err => {
reject(new Error(`${_lodash.default.capitalize(streamType)} '${err.syscall}' error: ${err.stack}`));
});
if (!opts.ignoreOutput) {
proc.stdout.on('data', data => {
stdoutArr.push(data);
if (opts.logger && _lodash.default.isFunction(opts.logger.debug)) {
opts.logger.debug(data);
}
});
if (opts.ignoreOutput) {
proc[streamType].on('data', () => {});
return;
}
}
if (proc.stderr) {
proc.stderr.on('error', err => {
reject(new Error(`Standard error '${err.syscall}' error: ${err.stack}`));
const {
chunks,
maxSize
} = streamProps;
let size = 0;
proc[streamType].on('data', chunk => {
chunks.push(chunk);
size += chunk.length;
while (chunks.length > 1 && size >= maxSize) {
size -= chunks[0].length;
chunks.shift();
}
if (opts.logger && _lodash.default.isFunction(opts.logger.debug)) {
opts.logger.debug(chunk.toString());
}
});
};
if (!opts.ignoreOutput) {
proc.stderr.on('data', data => {
stderrArr.push(data);
handleStream('stdout', {
maxSize: opts.maxStdoutBufferSize,
chunks: stdoutArr
});
handleStream('stderr', {
maxSize: opts.maxStderrBufferSize,
chunks: stderrArr
});
if (opts.logger && _lodash.default.isFunction(opts.logger.error)) {
opts.logger.error(data);
}
});
}
}
function getStdio(isBuffer) {

@@ -162,2 +177,2 @@ let stdout, stderr;

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9leGVjLmpzIl0sIm5hbWVzIjpbImV4ZWMiLCJjbWQiLCJhcmdzIiwib3B0cyIsInJlcCIsIk9iamVjdCIsImFzc2lnbiIsInRpbWVvdXQiLCJlbmNvZGluZyIsImtpbGxTaWduYWwiLCJjd2QiLCJ1bmRlZmluZWQiLCJlbnYiLCJwcm9jZXNzIiwiaWdub3JlT3V0cHV0Iiwic3RkaW8iLCJpc0J1ZmZlciIsInNoZWxsIiwibG9nZ2VyIiwiQiIsInJlc29sdmUiLCJyZWplY3QiLCJwcm9jIiwic3Rkb3V0QXJyIiwic3RkZXJyQXJyIiwidGltZXIiLCJvbiIsImVyciIsIm1zZyIsInN0YWNrIiwiZXJybm8iLCJFcnJvciIsInN0ZGluIiwic3lzY2FsbCIsInN0ZG91dCIsImRhdGEiLCJwdXNoIiwiXyIsImlzRnVuY3Rpb24iLCJkZWJ1ZyIsInN0ZGVyciIsImVycm9yIiwiZ2V0U3RkaW8iLCJCdWZmZXIiLCJjb25jYXQiLCJ0b1N0cmluZyIsImNvZGUiLCJjbGVhclRpbWVvdXQiLCJzZXRUaW1lb3V0Iiwia2lsbCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBRUE7O0FBQ0E7O0FBQ0E7O0FBQ0E7O0FBR0EsZUFBZUEsSUFBZixDQUFxQkMsR0FBckIsRUFBMEJDLElBQUksR0FBRyxFQUFqQyxFQUFxQ0MsSUFBSSxHQUFHLEVBQTVDLEVBQWdEO0FBRTlDLFFBQU1DLEdBQUcsR0FBRyx1QkFBTSxDQUFDSCxHQUFELEVBQU0sR0FBR0MsSUFBVCxDQUF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uICAgICAgICAvLyBhYm92ZVxuICAgICAgICBwcm9jLmtpbGwob3B0cy5raWxsU2lnbmFsKTtcbiAgICAgIH0sIG9wdHMudGltZW91dCk7XG4gICAgfVxuICB9KTtcbn1cblxuZXhwb3J0IHsgZXhlYyB9O1xuZXhwb3J0IGRlZmF1bHQgZXhlYztcbiJdLCJmaWxlIjoibGliL2V4ZWMuanMiLCJzb3VyY2VSb290IjoiLi4vLi4ifQ==

@@ -16,4 +16,2 @@ "use strict";

var _through = _interopRequireDefault(require("through"));
var _bluebird = _interopRequireDefault(require("bluebird"));

@@ -106,5 +104,3 @@

const handleOutput = data => {
const streams = _lodash.default.cloneDeep(data);
const handleOutput = streams => {
const {

@@ -160,7 +156,5 @@ stdout,

if (this.proc.stdout) {
this.proc.stdout.pipe((0, _through.default)(stdout => {
handleOutput({
stdout,
stderr: ''
});
this.proc.stdout.on('data', chunk => handleOutput({
stdout: chunk.toString(),
stderr: ''
}));

@@ -170,7 +164,5 @@ }

if (this.proc.stderr) {
this.proc.stderr.pipe((0, _through.default)(stderr => {
handleOutput({
stdout: '',
stderr
});
this.proc.stderr.on('data', chunk => handleOutput({
stdout: '',
stderr: chunk.toString()
}));

@@ -275,2 +267,2 @@ }

//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9zdWJwcm9jZXNzLmpzIl0sIm5hbWVzIjpbIkV2ZW50RW1pdHRlciIsImV2ZW50cyIsIk1BWF9MSU5FX1BPUlRJT05fTEVOR1RIIiwiY3V0U3VmZml4Iiwic3RyIiwic3VmZml4TGVuZ3RoIiwibGVuZ3RoIiwic3Vic3RyIiwiU3ViUHJvY2VzcyIsImNvbnN0cnVjdG9yIiwiY21kIiwiYXJncyIsIm9wdHMiLCJFcnJvciIsIl8iLCJpc1N0cmluZyIsImlzQXJyYXkiLCJwcm9jIiwiZXhwZWN0aW5nRXhpdCIsInJlcCIsImlzUnVubmluZyIsImVtaXRMaW5lcy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GV0YWNoUHJvY2VzcyAoKSB7XG4gICAgaWYgKCF0aGlzLm9wdHMuZGV0YWNoZWQpIHtcbiAgICAgIC8vIHRoaXMgbWVhbnMgdGhhdCB0aGVyZSBpcyBhIG1pc2NvbmZpZ3VyYXRpb24gaW4gdGhlIGNhbGxpbmcgY29kZVxuICAgICAgdGhyb3cgbmV3IEVycm9yKGBVbmFibGUgdG8gZGV0YWNoIHByb2Nlc3MgdGhhdCBpcyBub3Qgc3RhcnRlZCB3aXRoICdkZXRhY2hlZCcgb3B0aW9uYCk7XG4gICAgfVxuICAgIGlmICh0aGlzLnByb2MpIHtcbiAgICAgIHRoaXMucHJvYy51bnJlZigpO1xuICAgIH1cbiAgfVxuXG4gIGdldCBwaWQgKCkge1xuICAgIHJldHVybiB0aGlzLnByb2MgPyB0aGlzLnByb2MucGlkIDogbnVsbDtcbiAgfVxufVxuXG5leHBvcnQgeyBTdWJQcm9jZXNzIH07XG5leHBvcnQgZGVmYXVsdCBTdWJQcm9jZXNzO1xuIl0sImZpbGUiOiJsaWIvc3VicHJvY2Vzcy5qcyIsInNvdXJjZVJvb3QiOiIuLi8uLiJ9

@@ -8,2 +8,3 @@ /* eslint-disable promise/prefer-await-to-callbacks */

const MAX_BUFFER_SIZE = 100 * 1024 * 1024;

@@ -27,2 +28,4 @@ async function exec (cmd, args = [], opts = {}) {

logger: undefined,
maxStdoutBufferSize: MAX_BUFFER_SIZE,
maxStderrBufferSize: MAX_BUFFER_SIZE,
}, opts);

@@ -50,31 +53,41 @@

}
if (proc.stdout) {
proc.stdout.on('error', (err) => {
reject(new Error(`Standard output '${err.syscall}' error: ${err.stack}`));
});
// keep track of stdout if we have not said not to
if (!opts.ignoreOutput) {
proc.stdout.on('data', (data) => {
stdoutArr.push(data);
if (opts.logger && _.isFunction(opts.logger.debug)) {
opts.logger.debug(data);
}
});
const handleStream = (streamType, streamProps) => {
if (!proc[streamType]) {
return;
}
}
if (proc.stderr) {
proc.stderr.on('error', (err) => {
reject(new Error(`Standard error '${err.syscall}' error: ${err.stack}`));
proc[streamType].on('error', (err) => {
reject(new Error(`${_.capitalize(streamType)} '${err.syscall}' error: ${err.stack}`));
});
// keep track of stderr if we have not said not to
if (!opts.ignoreOutput) {
proc.stderr.on('data', (data) => {
stderrArr.push(data);
if (opts.logger && _.isFunction(opts.logger.error)) {
opts.logger.error(data);
}
});
if (opts.ignoreOutput) {
// https://github.com/nodejs/node/issues/4236
proc[streamType].on('data', () => {});
return;
}
}
// keep track of the stream if we don't want to ignore it
const {chunks, maxSize} = streamProps;
let size = 0;
proc[streamType].on('data', (chunk) => {
chunks.push(chunk);
size += chunk.length;
while (chunks.length > 1 && size >= maxSize) {
size -= chunks[0].length;
chunks.shift();
}
if (opts.logger && _.isFunction(opts.logger.debug)) {
opts.logger.debug(chunk.toString());
}
});
};
handleStream('stdout', {
maxSize: opts.maxStdoutBufferSize,
chunks: stdoutArr,
});
handleStream('stderr', {
maxSize: opts.maxStderrBufferSize,
chunks: stderrArr,
});
function getStdio (isBuffer) {

@@ -81,0 +94,0 @@ let stdout, stderr;

@@ -5,3 +5,2 @@ /* eslint-disable promise/prefer-await-to-callbacks */

import events from 'events';
import through from 'through';
const { EventEmitter } = events;

@@ -103,4 +102,3 @@ import B from 'bluebird';

// this function handles output that we collect from the subproc
const handleOutput = (data) => {
const streams = _.cloneDeep(data);
const handleOutput = (streams) => {
const {stdout, stderr} = streams;

@@ -159,11 +157,7 @@ // if we have a startDetector, run it on the output so we can resolve/

if (this.proc.stdout) {
this.proc.stdout.pipe(through(stdout => {
handleOutput({stdout, stderr: ''});
}));
this.proc.stdout.on('data', (chunk) => handleOutput({stdout: chunk.toString(), stderr: ''}));
}
if (this.proc.stderr) {
this.proc.stderr.pipe(through(stderr => {
handleOutput({stdout: '', stderr});
}));
this.proc.stderr.on('data', (chunk) => handleOutput({stdout: '', stderr: chunk.toString()}));
}

@@ -170,0 +164,0 @@

@@ -8,3 +8,3 @@ {

],
"version": "1.14.3",
"version": "1.15.0",
"author": "appium",

@@ -38,4 +38,3 @@ "license": "Apache-2.0",

"shell-quote": "^1.4.3",
"source-map-support": "^0.5.3",
"through": "^2.3.8"
"source-map-support": "^0.5.3"
},

@@ -42,0 +41,0 @@ "scripts": {

@@ -54,2 +54,4 @@ node-teen_process

logger: undefined,
maxStdoutBufferSize: 100 * 1024 * 1024, // 100 MB
maxStderrBufferSize: 100 * 1024 * 1024, // 100 MB
}

@@ -62,2 +64,5 @@ ```

Both buffer size limits are needed to avoid memory overflow while collecting
process output. If the overall size of output chunks for different stream types exceeds the the given one then the oldest chunks will be pulled out in order to keep the memory load within the acceptable ranges.
If you're on Windows, you'll want to pass `shell: true`, because `exec`

@@ -64,0 +69,0 @@ actually uses `spawn` under the hood, and is therefore subject to the issues

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