Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const kill = () => {
if (!exited) terminate(child.pid)
}
process.on('exit', kill)
async end() {
if (serverCompiler) {
terminate(process.pid);
}
return true;
},
};
child.removeListener('exit', resolve)
child.removeListener('error', reject)
}
function resolve() {
unlisten()
_resolve()
}
function reject(error: Error) {
unlisten()
_reject(error)
}
child.on('exit', resolve)
child.on('error', reject)
if (timeout) setTimeout((): any => reject(new Error('kill timed out')), timeout)
if (signal) child.kill(signal)
else terminate(child.pid)
})
}