Chokidar: Tracking single folder with ignored complex subdirectory tree is slow.

Created on 11 May 2017  路  3Comments  路  Source: paulmillr/chokidar

The goal is to look into a single folder to see if files are added/deleted/changed and ignore all the sub directories.

If I use the example from the readme in my home directory it is very slow to start even though I am ignoring all the sub directories.

var watcher = chokidar.watch(process.env.HOME, {
  ignored: /(^|[\/\\])\../,
  ignorePermissionErrors: true,
  alwaysStat: true,
  ignoreInitial: true
});

If I append the path with /. to make it a glob for the files it is very fast. But misses files with no extensions.

It seems that it is watching the whole sub directory tree.

I looked through the documentation and I couldn't find a way to make a glob which matched just the contents of a single dir but no sub dir.

Am I missing something?

Most helpful comment

depth: 0

All 3 comments

depth: 0

Can't believe I missed that, thank you!

No problem 馃樅

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikoladev picture nikoladev  路  6Comments

paulmillr picture paulmillr  路  9Comments

yebrahim picture yebrahim  路  4Comments

jwahlin picture jwahlin  路  7Comments

ORESoftware picture ORESoftware  路  3Comments