Node.js - Child Processes
You spawn a child process in Node.js that may exit with code 7 or be terminated by a signal. Which code snippet correctly logs the exit code or the signal name?
const { spawn } = require('child_process');
const child = spawn('node', ['-e', 'process.exit(7)']);
child.on('exit', (code, signal) => {
// What to log?
});