watchpack
Wrapper library for directory and file watching.
Concept
watchpack high level API doesn't map directly to watchers. Instead a three level architecture ensures that for each directory only a single watcher exists.
The high level API requests
DirectoryWatchers
from aWatcherManager
, which ensures that only a singleDirectoryWatcher
per directory is created.A user-faced
Watcher
can be obtained from aDirectoryWatcher
and provides a filtered view on theDirectoryWatcher
.Reference-counting is used on the
DirectoryWatcher
andWatcher
to decide when to close them.The real watchers (currently chokidar) are created by the
DirectoryWatcher
.Files are never watched directly. This should keep the watcher count low.
Watching can be started in the past. This way watching can start after file reading.
Symlinks are not followed, instead the symlink is watched.
API
Last updated