Closed jsines closed 1 year ago
You could massively reduce the memory use of this approach by keeping a hash of the files instead. Add them all to a map when they're initialized and only emit the event if the new hash is different.
Calculating hash can easily take a few seconds for a large file. If you have 300,000 files, calculating hashes will continue endlessly.
We won't implement it. If you need it, you can do this by yourself, by writing a thin wrapper on top of chokidar.
Describe the bug
When watching a directory for changes an event is emitted when a watched file is saved, even if there were no changes.
This was reported back in 2018 but was closed: https://github.com/paulmillr/chokidar/issues/673
This would be really helpful to fix. It's possible to work around the issue (I intend to) but I think it makes more sense being an option or the default behavior in the library itself.
The reasoning behind the original closure:
You could massively reduce the memory use of this approach by keeping a hash of the files instead. Add them all to a map when they're initialized and only emit the event if the new hash is different.
Versions (please complete the following information):
To Reproduce: