🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

c8js

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

c8js - npm Package Compare versions

Comparing version

to
0.2.1

1

lib/c8js.js

@@ -83,2 +83,1 @@ import checkCoverages from './check-coverages.js';

Object.defineProperty(c8js, name, { value });

77

lib/foreground-exec-async.js

@@ -163,48 +163,51 @@ import { spawn } from 'child_process';

export default function fgExecAsync(command, args, options = { }, process = globalThis.process)
export default async function fgExecAsync
(command, args, options = { }, process = globalThis.process)
{
function executor(resolve, reject)
{
try
const callback =
(error, stdio) =>
{
const callback =
(error, stdio) =>
callbackError = error;
unproxySignals();
process.removeListener('exit', childHangup);
if (error && options.failFast)
reject(error);
else
{
unproxySignals();
process.removeListener('exit', childHangup);
if (error && options.failFast)
reject(error);
else
const { stderr, stdout } = stdio;
const result =
{
const { stderr, stdout } = stdio;
const result =
{
status: child.exitCode,
signal: child.signalCode,
output: [null, stdout, stderr],
pid: child.pid,
stdout,
stderr,
error,
};
resolve(result);
}
};
const child = execFileWithStdIO(command, args, options, callback);
const unproxySignals = proxySignals(process, child);
const hangupSignal = process.platform !== 'win32' ? 'SIGHUP' : 'SIGTERM';
const childHangup =
() =>
{
child.kill(hangupSignal);
};
process.addListener('exit', childHangup);
}
catch (error)
status: child.exitCode,
signal: child.signalCode,
output: [null, stdout, stderr],
pid: child.pid,
stdout,
stderr,
error,
};
resolve(result);
}
};
const child = execFileWithStdIO(command, args, options, callback);
const unproxySignals = proxySignals(process, child);
const hangupSignal = process.platform !== 'win32' ? 'SIGHUP' : 'SIGTERM';
const childHangup =
() =>
{
reject(error);
}
child.kill(hangupSignal);
};
process.addListener('exit', childHangup);
}
return new Promise(executor);
function onfinally()
{
if (callbackError)
Error.captureStackTrace(callbackError, fgExecAsync);
}
let callbackError;
const result = await new Promise(executor).finally(onfinally);
return result;
}

@@ -211,0 +214,0 @@

{
"name": "c8js",
"version": "0.2.0",
"version": "0.2.1",
"description": "A modern, asynchronous Node.js API for c8",

@@ -5,0 +5,0 @@ "keywords": [