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: nodejs#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 committed Jul 13, 2020
1 parent 09476f7 commit f902170
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
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 f902170

Please sign in to comment.