Skip to content

Commit 75492cf

Browse files
committed
doc: add ignore option to fs.watch documentation
1 parent 45315c3 commit 75492cf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/api/fs.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,10 @@ added:
18371837
* `overflow` {string} Either `'ignore'` or `'throw'` when there are more events to be
18381838
queued than `maxQueue` allows. `'ignore'` means overflow events are dropped and a
18391839
warning is emitted, while `'throw'` means to throw an exception. **Default:** `'ignore'`.
1840+
* `ignore` {string|RegExp|Function|Array} Pattern(s) to ignore. Strings are
1841+
glob patterns (using [`minimatch`][]), RegExp patterns are tested against
1842+
the filename, and functions receive the filename and return `true` to
1843+
ignore. **Default:** `undefined`.
18401844
* Returns: {AsyncIterator} of objects with the properties:
18411845
* `eventType` {string} The type of change
18421846
* `filename` {string|Buffer|null} The name of the file changed.
@@ -4804,6 +4808,10 @@ changes:
48044808
* `encoding` {string} Specifies the character encoding to be used for the
48054809
filename passed to the listener. **Default:** `'utf8'`.
48064810
* `signal` {AbortSignal} allows closing the watcher with an AbortSignal.
4811+
* `ignore` {string|RegExp|Function|Array} Pattern(s) to ignore. Strings are
4812+
glob patterns (using [`minimatch`][]), RegExp patterns are tested against
4813+
the filename, and functions receive the filename and return `true` to
4814+
ignore. **Default:** `undefined`.
48074815
* `listener` {Function|undefined} **Default:** `undefined`
48084816
* `eventType` {string}
48094817
* `filename` {string|Buffer|null}
@@ -8764,6 +8772,7 @@ the file contents.
87648772
[`fsPromises.utimes()`]: #fspromisesutimespath-atime-mtime
87658773
[`inotify(7)`]: https://man7.org/linux/man-pages/man7/inotify.7.html
87668774
[`kqueue(2)`]: https://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
8775+
[`minimatch`]: https://github.com/isaacs/minimatch
87678776
[`util.promisify()`]: util.md#utilpromisifyoriginal
87688777
[bigints]: https://tc39.github.io/proposal-bigint
87698778
[caveats]: #caveats

0 commit comments

Comments
 (0)