nl_tokens: Extended : Invoke a callback with each filesystem event that occurs beneath a specified path . watchPath handles the efficient re - use of operating system resources across living watchers . Watching the same path more than once or the child of a watched path will re - use the existing native watcher . * rootPath { String } specifies the absolute path to the root of the filesystem content to watch . * options Control the watcher s behavior . * eventCallback { Function } or other callable to be called each time a batch of filesystem events is observed . * events { Array } of objects that describe the events that have occurred . * action { String } describing the filesystem action that occurred . One of created modified deleted or renamed . * kind { String } distinguishing the type of filesystem entry that was acted upon when available . One of file directory or unknown . * path { String } containing the absolute path to the filesystem entry that was acted upon . * oldPath For rename events { String } containing the filesystem entry s former absolute path . Returns a { Promise } that will resolve to a { PathWatcher } once it has started . Note that every { PathWatcher } is a { Disposable } so they can be managed by a { CompositeDisposable } if desired . js const { watchPath } = require (
pl_tokens: function watchPath ( rootPath , <mask> , eventCallback ) { const watcher = PathWatcherManager . instance ( ) . createWatcher ( rootPath , options , eventCallback ) return watcher . getStartPromise ( ) . then ( ( ) => watcher ) }