
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
child-exit-nodeback
Advanced tools
Observe a child_process's 'exit' and 'close' events and transform them into events with nodeback-style arguments (error, child).
Observe a child_process's 'exit' and 'close' events and transform them into events with nodeback-style arguments (error, child).
This module exports one function:
Given an EventEmitter ee (e.g. a child process object), subscribes to
the next exit and close event and re-emits them as described below.
Returns ee.
The re-emited events are named exit:nodeback and close:nodeback.
Their 2nd argument always is ee.
The 1st argument is either false or an Error object, depending on the
first two arguments of the original event interpreted as exit status
and kill signal, as a child_process would fire them.
The Error object will carry a property src which is set to ee,
and at least one of the properties retval (the exit code) or signal.
from test.usage.js:
var childExitNodeback = require('child-exit-nodeback'),
spawn = require('child_process').spawn;
function spawnNodeEval(js) { return spawn(process.execPath, ['-e', js]); }
test.add(function () {
var child = spawnNodeEval('// no-op');
equal(typeof child.pid, 'number');
childExitNodeback(child);
child.once('exit:nodeback', test.log.args('no-op exit'));
child.once('close:nodeback', test.log.args('no-op close'));
test.log.expect([
[ 'no-op exit', false, '{ChildProcess}' ],
[ 'no-op close', false, '{ChildProcess}' ],
]);
});
test.add(function () {
var child = childExitNodeback(spawnNodeEval('process.exit(42)'));
equal(typeof child.pid, 'number');
child.once('exit:nodeback', test.log.args('42 exit'));
child.once('close:nodeback', test.log.args('42 close'));
test.log.expect([
[ '42 exit', '{Error "Exit status 42"}', '{ChildProcess}' ],
[ '42 close', '{Error "Exit status 42"}', '{ChildProcess}' ],
]);
});
test.add(function () {
var child = spawnNodeEval('setTimeout(Function, 1e4);' +
'process.kill(process.pid, "SIGHUP");');
childExitNodeback(child);
child.once('exit:nodeback', test.log.args('hup exit'));
child.once('close:nodeback', test.log.args('hup close'));
test.log.expect([
[ 'hup exit', '{Error "Killed by signal SIGHUP"}', '{ChildProcess}' ],
[ 'hup close', '{Error "Killed by signal SIGHUP"}', '{ChildProcess}' ],
]);
});
ISC
FAQs
Observe a child_process's 'exit' and 'close' events and transform them into events with nodeback-style arguments (error, child).
The npm package child-exit-nodeback receives a total of 0 weekly downloads. As such, child-exit-nodeback popularity was classified as not popular.
We found that child-exit-nodeback demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.