PHPackages                             williameggers/reactphp-filesystem-monitor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. williameggers/reactphp-filesystem-monitor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

williameggers/reactphp-filesystem-monitor
=========================================

Asynchronous filesystem monitor based on ReactPHP

0.5.0(1mo ago)10MITPHPPHP &gt;=8.2

Since May 26Pushed 1mo agoCompare

[ Source](https://github.com/williameggers/reactphp-filesystem-monitor)[ Packagist](https://packagist.org/packages/williameggers/reactphp-filesystem-monitor)[ RSS](/packages/williameggers-reactphp-filesystem-monitor/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

ReactPHP Filesystem Monitor
===========================

[](#reactphp-filesystem-monitor)

This is a maintained fork of [react-filesystem-monitor](https://github.com/tsufeki/react-filesystem-monitor.git).

See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines and [SECURITY.md](SECURITY.md) for vulnerability reporting.

Original work:

- tsufeki (2016)

Maintained fork:

- William Eggers (2026–present)

Asynchronous filesystem monitor based on ReactPHP.

Currently these implementations are available:

- `INotifyExtensionMonitor` based on the [PECL `inotify` extension](https://pecl.php.net/package/inotify), preferred on Linux when the extension is installed.
- `INotifyProcessMonitor` based on [`inotifywait`](https://github.com/rvoicilas/inotify-tools/wiki) command line utility, used on Linux.
- `FsWatchProcessMonitor` based on [`fswatch`](http://emcrisostomo.github.io/fswatch/), used on OSX.

The factory prefers `INotifyExtensionMonitor` on Linux when the PECL extension is available, falls back to `INotifyProcessMonitor` otherwise, and uses `FsWatchProcessMonitor` on other platforms.

All implementations' constructors take two arguments: a path to watch (file or recursively watched directory) and optional array of event to watch for (defaults to all events).

Available events:

- `access` i.e. read
- `attribute` - modification of permissions, timestamps etc.
- `close`
- `create`
- `delete`
- `modify`
- `move_from`, `move_to` - file move, fired with source and destination path respectively. Only those for paths inside watched dir are fired.
- `open`

These events pass as arguments: path which triggered it, boolean indicating whether the path is a directory, event name and monitor instance itself.

Additional events:

- `all` - fired for all events above
- `start` - fired when watchers finished setting up
- `error`

Please note that not all backends support all events. `fswatch` won't emit `open` and `close` events; also `start` is fired immediately after process starts instead of when setup is complete.

The PECL `inotify` backend recursively registers watches for subdirectories and automatically adds watches for directories created or moved into the watched tree.

Example
-------

[](#example)

```
$loop = React\EventLoop\Factory::create();

$monitor = (new ReactFilesystemMonitor\FilesystemMonitorFactory())->create('foo/bar', ['modify', 'delete']);
$monitor->on('all', function ($path, $isDir, $event, $monitor) {
    echo sprintf("%s:  %s%s\n", $event, $path, $isDir ? ' [dir]' : '');
});
$monitor->start($loop);

$loop->run();
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance88

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 84% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

59d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6848430?v=4)[William Eggers](/maintainers/williameggers)[@williameggers](https://github.com/williameggers)

---

Top Contributors

[![tsufeki](https://avatars.githubusercontent.com/u/4078572?v=4)](https://github.com/tsufeki "tsufeki (21 commits)")[![williameggers](https://avatars.githubusercontent.com/u/6848430?v=4)](https://github.com/williameggers "williameggers (4 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/williameggers-reactphp-filesystem-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/williameggers-reactphp-filesystem-monitor/health.svg)](https://phpackages.com/packages/williameggers-reactphp-filesystem-monitor)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M26.2k](/packages/friendsofphp-php-cs-fixer)[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

43.2k341.0k1](/packages/ccxt-ccxt)[react/react

ReactPHP: Event-driven, non-blocking I/O with PHP.

9.1k3.7M65](/packages/react-react)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k420.9k26](/packages/team-reflex-discord-php)[react/child-process

Event-driven library for executing child processes with ReactPHP.

34191.0M160](/packages/react-child-process)[react/stream

Event-driven readable and writable streams for non-blocking I/O in ReactPHP

689146.0M213](/packages/react-stream)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
