I'm aware from this other StackOverflow answer that fs.watch() fires twice on some operating systems (I'm on Windows 11). The weird thing though however, is that while fs.watch() fires twice for me with a new setup and almost empty file, it fires three times for me when I'm running it in a complex/large script. Here is my complex script. I don't believe that it's a loop cycle issue, because 1) it returns console.logs in my fs.watch() function 2) it returns console.logs() directly inside the function that should be run after fs.watch() is triggered. For those interested I put a console.log() between these lines.
To put it into summary, I'd like to know whether three pulses is expected behavior on top of stated two pulses, and if it's not normal behavior, how to fix my code to restrict it only to two pulses, if possible.