Does the watch of nodejs perform callback twice?

what happened when I first used the nodejs API,watch method to call back twice?

the test.js code is as follows:

const fs = require("fs");
fs.watch("./a.txt", function(eventType,filename){
    console.log(eventType,filename);
});

A few simple lines of code, each time the a.txt file is modified, the log. will be printed twice

Mar.03,2021
A problem under

Windows . In the system, Windows API is called multiple times when modifying a file.
https://github.com/nodejs/nod.

Menu