Chokidar: add event for watching a folder shows all existing files as added

Created on 5 Apr 2016  路  2Comments  路  Source: paulmillr/chokidar

I apologise if this is the wrong place to post this question.

When I use "add" event for watching a folder with Chokidar all existing files are listed as added.
My platform is OSX.

Is this the correct behavior?

How can I prevent existing files from being listed and only show files that gets added?

The "change" event works as expected.

var watcher = chokidar.watch('/My/path', {
  ignored: /[\/\\]\./,
  persistent: true
});    

watcher
      .on('change',  function(path) { console.log("File " + path + " has been changed"); })
      .on('add',  function(path) {  console.log("File " + path + " has been added"); });

I'm using [email protected]

/Christian

Most helpful comment

ignoreInitial: true

All 2 comments

ignoreInitial: true

Great, thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bnainar picture bnainar  路  7Comments

j-fliegenschmidt picture j-fliegenschmidt  路  6Comments

ORESoftware picture ORESoftware  路  8Comments

AdaRoseCannon picture AdaRoseCannon  路  3Comments

IlijazM picture IlijazM  路  7Comments