metawatch
v1.2.2
Published
Deep nested directories watch for node.js
Downloads
292
Readme
Deep nested directories watch for node.js
- Watch directories recursive
- Rebuild recursive when new directories found or old directories remove
- Deduplicate events with debounce
Usage
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 });
});
Contributors
- Timur Shemsedinov [email protected]
- See github for full contributors list
License & Contributors
Copyright (c) 2020-2024 Metarhia contributors. Metawatch is MIT licensed. Metawatch is a part of Metarhia technology stack.