As of version 19.1.0, the Node.js fs module adds recursive watching on Linux.
Wondering if this means we can eventually stop using Chokidar…
https://github.com/nodejs/node/commit/3770d3a450fb3b65808d312cc33bdda3de92f6d4
As of version 19.1.0, the Node.js fs module adds recursive watching on Linux.
Wondering if this means we can eventually stop using Chokidar…
https://github.com/nodejs/node/commit/3770d3a450fb3b65808d312cc33bdda3de92f6d4
@tjgillis Chokidar is a library for file system watching. Nodemon is a tool for restating your server when your source code changes. (You could implement Nodemon using Chokidar.)
@aral I don't do much Js work so sorry if this is a stupid question. Why use chokidar over nodemon?
@comatory Yeah, it uses a native fsevents module on macOS.
Native watch also apparently interfaces with fsevents so not sure if native watch is up to par on macOS. Will have to run tests.
I really want to remove all native modules from Kitten (https://codeberg.org/kitten/app). Will make my life so much easier.
@aral nice it always feels difficult to have file watching functionality easily embedded. Chokidar also brings some compiled code if I’m not mistaken.
To answer my own question, no.
It looks like the recursive watch in Node.js does 5 second polling. If you turn recursive off, you get instant notifications (although two of each for an edit on a file).
If you’re looking for an alternative to Chokidar that doesn’t use any native modules for file system watching in Node.js, take a look at Watcher:
@aral thanks for posting this!! I was stuck with `chokidar` for a while!
@Frishi Chokidar is excellent, don’t get me wrong, but not having a native module is a huge advantage (at least for my use case).
076萌SNS is a social network, courtesy of 076. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.
All 076萌SNS content and data are available under the Creative Commons Attribution 3.0 license.