A Ruby gem that monitors file system changes and notifies your application with optimized OS-specific adapters.
Listen is a Ruby gem that monitors directories for file system changes and notifies your application via callbacks. It solves the problem of efficiently detecting when files are modified, added, or removed without resorting to manual polling, making it essential for tools that need to react to file changes automatically.
Ruby developers building tools like live-reload servers, build systems, testing frameworks, or any application that needs to respond to file changes in real-time.
Developers choose Listen for its robust, cross-platform file monitoring with optimized native adapters, simple API, and seamless integration into Ruby projects, eliminating the need to write low-level file-watching code.
The Listen gem listens to file modifications and notifies you about the changes.
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 native system calls on macOS, Linux, Windows, and BSD for high-efficiency change detection, as emphasized in the README's features.
Precisely distinguishes between file modifications, additions, and removals with separate callbacks, crucial for tools like Guard and Rails.
Supports regex patterns for ignoring or including files to reduce noise and improve performance, demonstrated via the :ignore and :only options.
Falls back to polling for unsupported environments like network filesystems, ensuring it works across diverse systems without crashing.
Symlinks are always followed and symlinked directories within watched paths aren't supported, which can cause unexpected behavior in complex setups.
The README explicitly notes performance limitations on macOS, especially with many files, impacting responsiveness in development tools.
Requires separate gems like 'wdm' on Windows or 'rb-kqueue' on BSD for optimal performance, adding setup complexity and potential maintenance.