How to use chokidar

Comprehensive chokidar code examples:

How to use chokidar.default:

84
85
86
87
88
89
90
91
92
93
    (_a = this.dirsWatchers.get(dirToUnwatch)) === null || _a === void 0 ? void 0 : _a.close();
    this.dirsWatchers.delete(dirToUnwatch);
});
dirsToWatch.forEach((dirToWatch) => {
    const interval = typeof (options === null || options === void 0 ? void 0 : options.poll) === 'number' ? options.poll : undefined;
    const dirWatcher = chokidar_1.default.watch(dirToWatch, {
        ignoreInitial: true,
        ignorePermissionErrors: true,
        ignored: (path) => isIgnored(path),
        usePolling: (options === null || options === void 0 ? void 0 : options.poll) ? true : undefined,

How to use chokidar.watch:

262
263
264
265
266
267
268
269
270
271
  }

  return site.generate();
})
.then(() => {
  const watcher = chokidar.watch(rootFolder, {
    ignored: [
      logsFolder,
      outputFolder,
      /(^|[/\\])\../,