- Watch directories recursive
- Rebuild recursive when new directories found or old directories remove
- Deduplicate events with debounce
const metawatch = require('metawatch');
const watcher = new metawatch.DirectoryWatcher({ timeout: 200 });
watcher.watch('/home/marcus/Downloads');
watcher.watch('/home/marcus/Documents');
watcher.on('change', (fileName) => {
console.log({ changed: fileName });
});
watcher.on('delete', (fileName) => {
console.log({ deleted: fileName });
});
watcher.on('before', (changes) => {
console.log({ changes });
});
watcher.on('after', (changes) => {
console.log({ changes });
});
- Timur Shemsedinov [email protected]
- See github for full contributors list
Copyright (c) 2020-2024 Metarhia contributors. Metawatch is MIT licensed. Metawatch is a part of Metarhia technology stack.