Efficiently watches the given roots
folders for changes.
Efficiently watches the given roots
folders for changes. Any time the
filesystem is modified within those folders, the onEvent
callback is
called with the paths to the changed files or folders.
Once the call to watch
returns, onEvent
is guaranteed to receive a
an event containing the path for:
- Every file or folder that gets created, deleted, updated or moved within the watched folders
- For copied or moved folders, the path of the new folder as well as every file or folder within it.
- For deleted or moved folders, the root folder which was deleted/moved, but *without* the paths of every file that was within it at the original location
Note that watch
does not provide any additional information about the
changes happening within the watched roots folder, apart from the path
at which the change happened. It is up to the onEvent
handler to query
the filesystem and figure out what happened, and what it wants to do.
watch
currently only supports Linux and Mac-OSX, and not Windows.