0

I am looking for a stable way to watch for changes on a file using Node.js. The easiest option fs.watch is unstable according to the docs. For me it works fine but it is always fired twice per a single change. The file is not really changed twice (on my OSX) and using EventMachine.watch_file the desired event is triggered exactly once per change.

However in gulp any watch-task also works fine: the event is triggered once per change.

So I have two questions: which library/function is used in gulp to watch file and how to use it instead of fs.watch? I am quite new to Node.js so surfing the sources of gulp didn't help me.

Community
  • 1
  • 1
overdawn
  • 321
  • 3
  • 10

1 Answers1

0

As Kevin_B mentioned, the answer is https://github.com/shama/gaze

overdawn
  • 321
  • 3
  • 10