Skip to content

Commit 948a79a

Browse files
committed
Address nits
1 parent 1af3825 commit 948a79a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

doc/api/process.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
712712
quickly as possible with the specified exit `code`. If the `code` is omitted,
713713
exit uses either the 'success' code `0` or the value of `process.exitCode` if
714714
specified.
@@ -723,8 +723,8 @@ The shell that executed Node.js should see the exit code as `1`.
723723

724724
It is important to note that calling `process.exit()` will force the process to
725725
exit 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

729729
In most situations, it is not actually necessary to call `process.exit()`
730730
explicitly. 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

766770
A number which will be the process exit code, when the process either

0 commit comments

Comments
 (0)