StatWatcher
Class: fs.StatWatcher
Since
v14.3.0, v12.20.0 Extends EventEmitter
A successful call to {@link watchFile} method will return a new fs.StatWatcher object.
Functions
Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbol
s.
Returns the current max listener value for the EventEmitter
which is either set by emitter.setMaxListeners(n)
or defaults to {@link defaultMaxListeners}.
By default EventEmitter
s will print a warning if more than 10
listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners()
method allows the limit to be modified for this specific EventEmitter
instance. The value can be set to Infinity
(or 0
) to indicate an unlimited number of listeners.
When called, the active fs.StatWatcher
object will not require the Node.js event loop to remain active. If there is no other activity keeping the event loop running, the process may exit before the fs.StatWatcher
object's callback is invoked. Calling watcher.unref()
multiple times will have no effect.