Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace fs.watch with chokidar #369

Merged
merged 1 commit into from
Feb 16, 2024
Merged

Replace fs.watch with chokidar #369

merged 1 commit into from
Feb 16, 2024

Conversation

bonanitech
Copy link
Member

This excerpt from the chokidar documentation explains the reasoning behind this change.

Why?

Node.js fs.watch:

  • Doesn't report filenames on MacOS.
  • Doesn't report events at all when using editors like Sublime on MacOS.
  • Often reports events twice.
  • Emits most changes as rename.
  • Does not provide an easy way to recursively watch file trees.
  • Does not support recursive watching on Linux.

Node.js fs.watchFile:

  • Almost as bad at event handling.
  • Also does not provide any recursive watching.
  • Results in high CPU utilization.

Chokidar resolves these problems.

@bonanitech bonanitech added the enhancement New feature or request label Feb 16, 2024
@bonanitech bonanitech merged commit 3c0ebb6 into dev Feb 16, 2024
2 checks passed
@bonanitech bonanitech deleted the chokidar branch February 16, 2024 17:06
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant