SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function watchBegin(filePath){
  2.         watcher = chokidar.watch(filePath,{
  3.             persistent:true,
  4.             ignoreInitial:true,//開始当初のフォルダーは反応させない
  5.             depth:0//0にしないと再帰的にファイルをチェックするっぽい
  6.         });
  7.         watcher.on("add",f => {console.log(`file ${f} has been added`)
  8.                 dispatchJSX(f);              
  9.                 })
  10.                 .on("change",f => console.log(`file ${f} has been changed`))
  11.                 .on("unlink",f => console.log(`file ${f} has been removed`));
  12.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top