@@ -534,8 +534,6 @@ The synchronous version of `fs.appendFile`.
534
534
535
535
## fs.watchFile(filename[ , options] , listener)
536
536
537
- Stability: 2 - Unstable. Use fs.watch instead, if possible.
538
-
539
537
Watch for changes on ` filename ` . The callback ` listener ` will be called each
540
538
time the file is accessed.
541
539
@@ -558,9 +556,11 @@ These stat objects are instances of `fs.Stat`.
558
556
If you want to be notified when the file was modified, not just accessed
559
557
you need to compare ` curr.mtime ` and ` prev.mtime ` .
560
558
561
- ## fs.unwatchFile(filename[ , listener] )
559
+ _ Note: ` 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._
562
562
563
- Stability: 2 - Unstable. Use fs.watch instead, if possible.
563
+ ## fs.unwatchFile(filename [ , listener ] )
564
564
565
565
Stop watching for changes on ` filename ` . If ` listener ` is specified, only that
566
566
particular listener is removed. Otherwise, * all* listeners are removed and you
@@ -569,9 +569,11 @@ have effectively stopped watching `filename`.
569
569
Calling ` fs.unwatchFile() ` with a filename that is not being watched is a
570
570
no-op, not an error.
571
571
572
- ## fs.watch(filename[ , options] [ , listener ] )
572
+ _ Note: ` 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._
573
575
574
- Stability: 2 - Unstable.
576
+ ## fs.watch(filename [ , options ] [ , listener ] )
575
577
576
578
Watch for changes on ` filename ` , where ` filename ` is either a file or a
577
579
directory. The returned object is a [ fs.FSWatcher] ( #fs_class_fs_fswatcher ) .
0 commit comments