* True when an error is Linux inotify *watch-count* exhaustion. `fs.watch` * surfaces a hit `fs.inotify.max_user_watches` as ENOSPC ("no space" = no watch * descriptors left, NOT disk space). This only arises on the Linux * per-directory path; it is non-fatal (raise the limit and partial watching
(err: unknown)
| 115 | * keeps working), so it warns rather than degrading. |
| 116 | */ |
| 117 | function isInotifyWatchExhaustion(err: unknown): boolean { |
| 118 | return (err as NodeJS.ErrnoException | undefined)?.code === 'ENOSPC'; |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Native recursive `fs.watch` is only reliable on macOS and Windows; on Linux |