Add an ignore option to fs.watch() to filter filesystem events.
ignore
fs.watch()
Type: string | RegExp | Function | Array<string | RegExp | Function>
string | RegExp | Function | Array<string | RegExp | Function>
fs.watch(dir, { ignore: '*.log' }); fs.watch(dir, { ignore: /\.tmp$/ }); fs.watch(dir, { ignore: (f) => f.startsWith('.') }); fs.watch(dir, { ignore: ['*.log', /\.tmp$/] });
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add an
ignoreoption tofs.watch()to filter filesystem events.Type:
string | RegExp | Function | Array<string | RegExp | Function>