Skip to content

Commit

Permalink
doc: improve text in fs docs about omitting callbacks
Browse files Browse the repository at this point in the history
Repair misplaced colon and condense text.

PR-URL: #34307
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and addaleax committed Sep 22, 2020
1 parent c4f0cb6 commit ba7ba4f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions doc/api/fs.md
Expand Up @@ -79,13 +79,10 @@ In busy processes, use the asynchronous versions of these calls. The synchronous
versions will block the entire process until they complete, halting all
connections.

While it is not recommended, most fs functions allow the callback argument to
be omitted, in which case a default callback is used that rethrows errors. To
get a trace to the original call site, set the `NODE_DEBUG` environment
variable:

Omitting the callback function on asynchronous fs functions is deprecated and
may result in an error being thrown in the future.
Most asynchronous `fs` functions allow the callback argument to be omitted.
However, this usage is deprecated. When the callback is omitted, a default
callback is used that rethrows errors. To get a trace to the original call site,
set the `NODE_DEBUG` environment variable:

```console
$ cat script.js
Expand Down

0 comments on commit ba7ba4f

Please sign in to comment.