注意事项


🌐 Caveats

fs.watch API 在各个平台上的表现并不完全一致,并且在某些情况下无法使用。

🌐 The fs.watch API is not 100% consistent across platforms, and is unavailable in some situations.

递归选项仅在 macOS 和 Windows 上受支持。当在不支持该选项的平台上使用时,将抛出 ERR_FEATURE_UNAVAILABLE_ON_PLATFORM 异常。

🌐 The recursive option is only supported on macOS and Windows. An ERR_FEATURE_UNAVAILABLE_ON_PLATFORM exception will be thrown when the option is used on a platform that does not support it.

在 Windows 上,如果被监视的目录被移动或重命名,将不会触发任何事件。删除被监视的目录时,会报告 EPERM 错误。

🌐 On Windows, no events will be emitted if the watched directory is moved or renamed. An EPERM error is reported when the watched directory is deleted.