The ๐ณ๐๐ฃ๐ฟ๐ผ๐บ๐ถ๐๐ฒ๐.๐๐ฎ๐๐ฐ๐ต method returns an async iterator that watches for changes on ๐ณ๐ถ๐น๐ฒ๐ป๐ฎ๐บ๐ฒ, where ๐ณ๐ถ๐น๐ฒ๐ป๐ฎ๐บ๐ฒ is either a file or a directory.
By default, it uses ๐๐๐ณ๐ด encoding and keeps the process running as long as the file/dir is being watched.
Optionally, you could pass an ๐๐ฏ๐ผ๐ฟ๐๐ฆ๐ถ๐ด๐ป๐ฎ๐น to signal when the watcher should stop.
Keep in mind that this API comes with a few caveats. For example, not being consistent across platforms; the recursive option is only supported on macOS and Windows.
So make sure to check all the caveats..
Did you learn something new today?
Like and share this post, and follow me for more!
Top comments (0)