Skip to content

Commit b427e9c

Browse files
authored
Update example dotfiles regex
1 parent c21a65c commit b427e9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Then `require` and use it in your code:
6161
var chokidar = require('chokidar');
6262

6363
// One-liner for current directory, ignores .dotfiles
64-
chokidar.watch('.', {ignored: /[\/\\]\./}).on('all', (event, path) => {
64+
chokidar.watch('.', {ignored: /(^|[\/\\])\../}).on('all', (event, path) => {
6565
console.log(event, path);
6666
});
6767
```
@@ -71,7 +71,7 @@ chokidar.watch('.', {ignored: /[\/\\]\./}).on('all', (event, path) => {
7171

7272
// Initialize watcher.
7373
var watcher = chokidar.watch('file, dir, glob, or array', {
74-
ignored: /[\/\\]\./,
74+
ignored: /(^|[\/\\])\../,
7575
persistent: true
7676
});
7777

0 commit comments

Comments
 (0)