watch-tree-maintained
v0.1.2
Published
Yet another library for watching FS trees. Includes a JSON-on-stdout command-line tool and {filePreexisted,allPreexistingFilesReported} events.
Downloads
1,730
Readme
watch-tree
...is yet another NodeJS FS-watching library. If it happens to suit your needs better than the others, enjoy!
The current implementation maintains a ring of paths (both files and dirs), and stats the next one every (--sample-rate=) ms.
More efficient implementations will be added eventually, including inotify (for Linux) and FSEvents (for Mac), with the appropriate one being compiled at (npm install)-time.
Your code won't notice the difference when that happens, but your battery life might.
Installing
Command-line tool
Usage
Example
stdout:
NodeJS
The watcher returned by .watchTree is a NodeJS EventEmitter instance.
Events
...where stats is a NodeJS fs.Stats instance.