FSWatcher

sealed external interface FSWatcher : EventEmitter(source)

Functions

Link copied to clipboard
abstract fun addListener(event: String, listener: Function<Unit>)

events.EventEmitter

abstract fun addListener(event: FSWatcherEvent.CHANGE, listener: (eventType: String, filename: Any) -> Unit)
abstract fun addListener(event: FSWatcherEvent.CLOSE, listener: () -> Unit)
abstract fun addListener(event: FSWatcherEvent.ERROR, listener: (JsError) -> Unit)
Link copied to clipboard
abstract fun close()

Stop watching for changes on the given fs.FSWatcher. Once stopped, the fs.FSWatcher object is no longer usable.

Link copied to clipboard

Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

Link copied to clipboard

Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to {@link defaultMaxListeners}.

Link copied to clipboard
abstract fun on(event: String, listener: Function<Unit>)
abstract fun on(event: FSWatcherEvent.CHANGE, listener: (eventType: String, filename: Any) -> Unit)
abstract fun on(event: FSWatcherEvent.CLOSE, listener: () -> Unit)
abstract fun on(event: FSWatcherEvent.ERROR, listener: (JsError) -> Unit)
Link copied to clipboard
abstract fun once(event: String, listener: Function<Unit>)
abstract fun once(event: FSWatcherEvent.CHANGE, listener: (eventType: String, filename: Any) -> Unit)
abstract fun once(event: FSWatcherEvent.CLOSE, listener: () -> Unit)
abstract fun once(event: FSWatcherEvent.ERROR, listener: (JsError) -> Unit)
Link copied to clipboard
abstract fun prependListener(event: String, listener: Function<Unit>)
abstract fun prependListener(event: FSWatcherEvent.CHANGE, listener: (eventType: String, filename: Any) -> Unit)
abstract fun prependListener(event: FSWatcherEvent.CLOSE, listener: () -> Unit)
abstract fun prependListener(event: FSWatcherEvent.ERROR, listener: (JsError) -> Unit)
Link copied to clipboard
abstract fun prependOnceListener(event: String, listener: Function<Unit>)
abstract fun prependOnceListener(event: FSWatcherEvent.CHANGE, listener: (eventType: String, filename: Any) -> Unit)
abstract fun prependOnceListener(event: FSWatcherEvent.CLOSE, listener: () -> Unit)
abstract fun prependOnceListener(event: FSWatcherEvent.ERROR, listener: (JsError) -> Unit)
Link copied to clipboard
abstract fun ref()

When called, requests that the Node.js event loop not exit so long as the fs.FSWatcher is active. Calling watcher.ref() multiple times will have no effect.

Link copied to clipboard

By default EventEmitters 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.

Link copied to clipboard
abstract fun unref()

When called, the active fs.FSWatcher 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.FSWatcher object's callback is invoked. Calling watcher.unref() multiple times will have no effect.