-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursive fs.watch for linux #36005
Comments
@fabiospampinato, I think this issue belongs to https://github.com/libuv/libuv which provides the underlying feature. The problem is however, that the native interfaces - |
It looks like there was an issue about this but it didn't receive much consideration: libuv/libuv#1778 IMO there should be an issue about this in Node's repo too, since Node already provides recursive watching support for macOS and Windows, obviously ideally Linux distros should be supported too. Whether the implementation comes from a dependency of Node or Node itself I don't think it matters for actual users, and whether this feature can be implemented perfectly or not I would argue doesn't matter much either because if it can't be implemented perfectly Linux users are still going to need some sort of recursive watching, it's no coincidence that stuff like chokidar have ~30M weekly downloads. If we agree that this is a feature Node should provide, and libuv doesn't want to code it, what should Node do then? |
Any updates? For linux I wonder if it would be possible to get all the folders recursively and run a for loop on each of them? |
I’m working on this issue. |
One question, I wonder why |
Yes it will be but this change needs to be implemented in libuv. |
Ah, thanks. I'm asking because right now I am confused - how to know when all notifiers have been set up (using the fsPromises version)? I am currently using Chokidar, but I guess its much slower as it manually sets up watches for each file in the recursive mode (I guess that's necessary to support the |
Is your feature request related to a problem? Please describe.
File system watching is a core part of many kinds of node apps, currently
fs.watch
is close to providing everything needed for watching files and directories easily, but not supporting recursive watching under Linux is a deal breaker.Describe the solution you'd like
The
recursive
option offs.watch
should be supported under Linux too.Describe alternatives you've considered
There are no great alternatives really, file system watching is a mess and Node should handle it reliably, the only other option is to use a third-party filesystem watcher or write one, all the ones I've tried are either unreliable in some way, come with a big performance downside under some scenarios, or rely on some native dependency that's a pain to work with for cross-platform apps.
If this issue is a duplicate I couldn't find the original one.
The text was updated successfully, but these errors were encountered: