Recall & Review
beginner
What is an exit code in the context of a child process in Node.js?
An exit code is a number returned by a child process when it finishes running. It tells if the process ended successfully or if there was an error.
Click to reveal answer
beginner
What does an exit code of 0 usually mean for a child process?
An exit code of 0 means the child process finished successfully without errors.
Click to reveal answer
intermediate
How can you listen for a child process exit event in Node.js?
You can listen for the 'exit' event on the child process object to get the exit code and signal when the process ends.
Click to reveal answer
beginner
What does a non-zero exit code indicate?
A non-zero exit code means the child process ended with an error or was terminated unexpectedly.
Click to reveal answer
intermediate
What is the difference between the 'exit' and 'close' events on a child process?
The 'exit' event gives the exit code and signal when the process ends. The 'close' event fires after all stdio streams are closed, indicating the process fully finished.
Click to reveal answer
What does an exit code of 0 from a child process mean?
✗ Incorrect
An exit code of 0 means the process finished successfully without errors.
Which event do you listen to get the exit code of a child process in Node.js?
✗ Incorrect
The 'exit' event provides the exit code and signal when the child process ends.
What does a non-zero exit code usually indicate?
✗ Incorrect
Non-zero exit codes indicate errors or abnormal termination of the child process.
What is the difference between the 'exit' and 'close' events on a child process?
✗ Incorrect
'exit' event gives exit code and signal; 'close' event fires after all stdio streams close.
If a child process is terminated by a signal, what will the exit code be?
✗ Incorrect
When terminated by a signal, the exit code is null and the signal name is provided instead.
Explain what child process exit codes are and how you can use them in Node.js.
Think about how a child process tells you if it finished well or had problems.
You got /4 concepts.
Describe the difference between the 'exit' and 'close' events on a Node.js child process and why both might be useful.
Consider what happens when a process ends versus when its output streams finish.
You got /4 concepts.