@@ -708,7 +708,7 @@ Example:
708708
709709* ` code ` {Integer} The exit code. Defaults to ` 0 ` .
710710
711- The ` process.exit() ` methods instructs Node.js to terminate the process as
711+ The ` process.exit() ` method instructs Node.js to terminate the process as
712712quickly as possible with the specified exit ` code ` . If the ` code ` is omitted,
713713exit uses either the 'success' code ` 0 ` or the value of ` process.exitCode ` if
714714specified.
@@ -723,8 +723,8 @@ The shell that executed Node.js should see the exit code as `1`.
723723
724724It is important to note that calling ` process.exit() ` will force the process to
725725exit as quickly as possible * even if there are still asynchronous operations
726- pending* in the event loop , * including* i/o operations to ` process.stdout ` and
727- ` process.stderr ` .
726+ pending* that have not yet completed fully , * including* I/O operations to
727+ ` process.stdout ` and ` process. stderr` .
728728
729729In most situations, it is not actually necessary to call ` process.exit() `
730730explicitly. The Node.js process will exit on it's own * if there is no additional
@@ -761,6 +761,10 @@ if (someConditionNotMet()) {
761761}
762762```
763763
764+ If it is necessary to terminate the Node.js process due to an error condition,
765+ throwing an * uncaught* error and allowing the process to terminate accordingly
766+ is safer than calling ` process.exit() ` .
767+
764768## process.exitCode
765769
766770A number which will be the process exit code, when the process either
0 commit comments