Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Sep 14, 2024
1 parent 694418d commit e1ebba0
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,18 @@ let watchedPaths = watcher.getWatched();
// Un-watch some files.
await watcher.unwatch('new-file');

// Stop watching.
// The method is async!
watcher.close().then(() => console.log('closed'));
// Stop watching. The method is async!
await watcher.close().then(() => console.log('closed'));

// Full list of options. See below for descriptions.
// Do not use this example!
chokidar.watch('file', {
persistent: true,

ignored: (file, _stats) => file.endsWith('.txt'),
ignoreInitial: false,
// ignore .txt files
ignored: (file) => file.endsWith('.txt'),
// watch only .txt files
// ignored: (file, _stats) => _stats?.isFile() && !file.endsWith('.txt'),

awaitWriteFinish: true, // emit single event when chunked writes are completed
atomic: true // emit proper events when "atomic writes" (mv _tmp file) are used
Expand All @@ -126,9 +127,10 @@ chokidar.watch('file', {
depth: 99,

followSymlinks: true,
ignoreInitial: false,
ignorePermissionErrors: false,
usePolling: false,
alwaysStat: false,
ignorePermissionErrors: false,
});

```
Expand All @@ -148,10 +150,9 @@ after `ready`, even if the process continues to run.

#### Path filtering

* `ignored` ([anymatch](https://github.com/es128/anymatch)-compatible definition)
Defines files/paths to be ignored. The whole relative or absolute path is
tested, not just filename. If a function with two arguments is provided, it
gets called twice per path - once with a single argument (the path), second
* `ignored` function, regex, or path. Defines files/paths to be ignored.
The whole relative or absolute path is tested, not just filename. If a function with two arguments
is provided, it gets called twice per path - once with a single argument (the path), second
time with two arguments (the path and the
[`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats)
object of that path).
Expand Down

0 comments on commit e1ebba0

Please sign in to comment.