在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ nodejs 的watch執(zhí)行回調(diào)兩次?

nodejs 的watch執(zhí)行回調(diào)兩次?

初次使用nodejs API,watch方法回調(diào)兩次是怎么回事?

test.js代碼如下:

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

簡單的幾行代碼,每次修改a.txt文件,都會打印兩次log.

回答
編輯回答
擱淺

Windows下的問題,在系統(tǒng)中,修改一個(gè)文件調(diào)用了多次Windows API。
https://github.com/nodejs/nod...

2017年7月8日 06:51