You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Takes a path string, an array of path strings, a [glob][micromatch] string or an array of [glob][micromatch] strings as `globs` to watch on the filesystem. Also optionally takes `options` to configure the watcher and a `fn` to execute when a file changes.
56
56
57
-
__Note: As of 5.0.0, globs must use `/` as the separator character because `\\` is reserved for escape sequences (as per the Bash 4.3 & Micromatch specs). This means you can't use `path.join()` or `__dirname`in Windows environments. If you need to use`path.join()`, you can use [normalize-path][normalize-path] against your paths afterwards. If you need to use `__dirname`, you can set it as the `cwd` option that gets passed directly to [chokidar][chokidar]. The [micromatch docs][micromatch-backslashes] contain more information about backslashes.__
57
+
**Note: As of 5.0.0, globs must use `/` as the separator character because `\\` is reserved for escape sequences (as per the Bash 4.3 & Micromatch specs). This means you can't use `path.join()` or `**dirname`in Windows environments. If you need to use`path.join()`, you can use [normalize-path][normalize-path] against your paths afterwards. If you need to use `**dirname`, you can set it as the `cwd` option that gets passed directly to [chokidar][chokidar]. The [micromatch docs][micromatch-backslashes] contain more information about backslashes.**
58
58
59
59
Returns an instance of [chokidar][chokidar].
60
60
@@ -63,10 +63,11 @@ Returns an instance of [chokidar][chokidar].
63
63
If the `fn` is passed, it will be called when the watcher emits a `change`, `add` or `unlink` event. It is automatically debounced with a default delay of 200 milliseconds and subsequent calls will be queued and called upon completion. These defaults can be changed using the `options`.
64
64
65
65
The `fn` is passed a single argument, `callback`, which is a function that must be called when work in the `fn` is complete. Instead of calling the `callback` function, [async completion][async-completion] can be signalled by:
66
-
* Returning a `Stream` or `EventEmitter`
67
-
* Returning a `Child Process`
68
-
* Returning a `Promise`
69
-
* Returning an `Observable`
66
+
67
+
- Returning a `Stream` or `EventEmitter`
68
+
- Returning a `Child Process`
69
+
- Returning a `Promise`
70
+
- Returning an `Observable`
70
71
71
72
Once async completion is signalled, if another run is queued, it will be executed.
72
73
@@ -76,7 +77,7 @@ Once async completion is signalled, if another run is queued, it will be execute
76
77
77
78
If set to `false` the `fn` is called during [chokidar][chokidar] instantiation as it discovers the file paths. Useful if it is desirable to trigger the `fn` during startup.
78
79
79
-
__Passed through to [chokidar][chokidar], but defaulted to `true` instead of `false`.__
80
+
**Passed through to [chokidar][chokidar], but defaulted to `true` instead of `false`.**
0 commit comments