Skip to content

Commit 8642933

Browse files
committed
doc: rm redundant inline stability notices, incorporate advisory text in main doc text, expand advisory with brief explanation
1 parent ee14abb commit 8642933

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

doc/api/fs.markdown

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,6 @@ The synchronous version of `fs.appendFile`.
534534

535535
## fs.watchFile(filename[, options], listener)
536536

537-
Stability: 2 - Stable. Use fs.watch instead, if possible.
538-
539537
Watch for changes on `filename`. The callback `listener` will be called each
540538
time the file is accessed.
541539

@@ -558,9 +556,11 @@ These stat objects are instances of `fs.Stat`.
558556
If you want to be notified when the file was modified, not just accessed
559557
you need to compare `curr.mtime` and `prev.mtime`.
560558

561-
## fs.unwatchFile(filename[, listener])
559+
`fs.watch` is more efficient than `fs.watchFile` and `fs.unwatchFile`.
560+
`fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile`
561+
when possible.
562562

563-
Stability: 2 - Stable. Use fs.watch instead, if possible.
563+
## fs.unwatchFile(filename[, listener])
564564

565565
Stop watching for changes on `filename`. If `listener` is specified, only that
566566
particular listener is removed. Otherwise, *all* listeners are removed and you
@@ -569,6 +569,10 @@ have effectively stopped watching `filename`.
569569
Calling `fs.unwatchFile()` with a filename that is not being watched is a
570570
no-op, not an error.
571571

572+
`fs.watch` is more efficient than `fs.watchFile` and `fs.unwatchFile`.
573+
`fs.watch` should be used instead of `fs.watchFile` and `fs.unwatchFile`
574+
when possible.
575+
572576
## fs.watch(filename[, options][, listener])
573577

574578
Watch for changes on `filename`, where `filename` is either a file or a

0 commit comments

Comments
 (0)