Skip to content

Commit 6483bc2

Browse files
TrottFishrock123
authored andcommitted
doc: clarify options for fs.watchFile()
The explanation for the `options` argument to `fs.watchFile()` had missing punctuation. I took the opportunity to try to rewrite the paragraph for greater clarity. PR-URL: nodejs#2425 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
1 parent 850c794 commit 6483bc2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

doc/api/fs.markdown

+6-5
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,12 @@ The synchronous version of `fs.appendFile`. Returns `undefined`.
557557
Watch for changes on `filename`. The callback `listener` will be called each
558558
time the file is accessed.
559559

560-
The second argument is optional. The `options` if provided should be an object
561-
containing two members a boolean, `persistent`, and `interval`. `persistent`
562-
indicates whether the process should continue to run as long as files are
563-
being watched. `interval` indicates how often the target should be polled,
564-
in milliseconds. The default is `{ persistent: true, interval: 5007 }`.
560+
The `options` argument may be omitted. If provided, it should be an object. The
561+
`options` object may contain a boolean named `persistent` that indicates
562+
whether the process should continue to run as long as files are being watched.
563+
The `options` object may specify an `interval` property indicating how often the
564+
target should be polled in milliseconds. The default is
565+
`{ persistent: true, interval: 5007 }`.
565566

566567
The `listener` gets two arguments the current stat object and the previous
567568
stat object:

0 commit comments

Comments
 (0)