Chokidar: What is the 'raw' event?

Created on 21 Mar 2017  路  4Comments  路  Source: paulmillr/chokidar

If I use chokidar to index a small unix file system in a docker container, the ready event isn't fired. Instead, I get multiple instances of the raw event. What does this event mean?

FWIW, I have ignorePermissionErrors set to true.

Most helpful comment

The first argument passed with the raw event from chokidar is the name of the event as it was passed from fs.watch() (or fsevents or fs.watchFile() depending on the watch mode chokidar is in).

raw is intended more for debugging purposes than for relying upon in regular software usage

Usage example from the readme:

  watcher.on('raw', (event, path, details) => {
    log('Raw event info:', event, path, details);
  });

details does not have a fixed object structure since it depends on what gets passed along from the various watch modes.

All 4 comments

The raw event is a pass-through of the events emitted by the underlying watch mechanisms chokidar uses. If you were to use node's fs.watch() directly, that's what it would be emitting.

It is not related to the ready event. Never receiving a ready event is a bug, and there are a couple existing issues discussing circumstances that cause that to happen.

I see, thanks.
Incidentally, I can't seem to find any documentation on a "raw" event emitted by fs.watch(), do you know of any?

The first argument passed with the raw event from chokidar is the name of the event as it was passed from fs.watch() (or fsevents or fs.watchFile() depending on the watch mode chokidar is in).

raw is intended more for debugging purposes than for relying upon in regular software usage

Usage example from the readme:

  watcher.on('raw', (event, path, details) => {
    log('Raw event info:', event, path, details);
  });

details does not have a fixed object structure since it depends on what gets passed along from the various watch modes.

Awesome. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Pomax picture Pomax  路  3Comments

ORESoftware picture ORESoftware  路  3Comments

Tilogorn picture Tilogorn  路  6Comments

jbreckmckye picture jbreckmckye  路  7Comments

ORESoftware picture ORESoftware  路  6Comments