A cross-platform file change monitor with multiple backends for macOS, BSD, Solaris, Linux, Windows, and stat-based polling.
fswatch is a command-line tool and library that monitors files and directories for changes, emitting notifications when modifications occur. It solves the problem of detecting file system changes in a portable way across different operating systems by utilizing the most efficient native API available on each platform.
System administrators, developers, and automation engineers who need to trigger actions (like builds, syncs, or restarts) in response to file changes in cross-platform environments.
Developers choose fswatch for its comprehensive cross-platform support, leveraging native OS APIs for performance where available, and its flexibility in filtering and formatting output for integration into scripts and pipelines.
A cross-platform file change monitor with multiple backends: Apple macOS File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages the most efficient OS-specific APIs like macOS FSEvents and Linux inotify for real-time monitoring, ensuring performance where supported while abstracting platform differences.
Supports including and excluding paths with regular expressions, allowing precise control over which file changes trigger events, as highlighted in the features section.
Watches entire directory hierarchies at any depth without manual setup, making it ideal for complex project structures or log directories.
Allows tailoring event record formats to suit different processing needs, facilitating easy integration into scripts and pipelines for automation.
The kqueue monitor opens a file descriptor per file, scaling poorly with many files and risking resource exhaustion, as admitted in the limitations section.
On Linux, queue overflows cause exceptions instead of graceful recovery, which can break monitoring in high-event scenarios without robust error handling.
Only supports directory monitoring, not individual files, increasing overhead and complexity for file-specific watches, as noted in the usage recommendations.
Relies on stat polling, degrading linearly with file count and requiring significant memory (e.g., 150 MB for 500,000 files), making it inefficient for large-scale use.