Skip to content

Commit ba7ba4f

Browse files
Trottaddaleax
authored andcommitted
doc: improve text in fs docs about omitting callbacks
Repair misplaced colon and condense text. PR-URL: #34307 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent c4f0cb6 commit ba7ba4f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

doc/api/fs.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,10 @@ In busy processes, use the asynchronous versions of these calls. The synchronous
7979
versions will block the entire process until they complete, halting all
8080
connections.
8181

82-
While it is not recommended, most fs functions allow the callback argument to
83-
be omitted, in which case a default callback is used that rethrows errors. To
84-
get a trace to the original call site, set the `NODE_DEBUG` environment
85-
variable:
86-
87-
Omitting the callback function on asynchronous fs functions is deprecated and
88-
may result in an error being thrown in the future.
82+
Most asynchronous `fs` functions allow the callback argument to be omitted.
83+
However, this usage is deprecated. When the callback is omitted, a default
84+
callback is used that rethrows errors. To get a trace to the original call site,
85+
set the `NODE_DEBUG` environment variable:
8986

9087
```console
9188
$ cat script.js

0 commit comments

Comments
 (0)