https://github.com/metarhia/metawatch
Nested directories watch for node.js 🕵️
https://github.com/metarhia/metawatch
impress isolate isolation metarhia nodejs sandbox sandboxing v8 vm
Last synced: about 1 year ago
JSON representation
Nested directories watch for node.js 🕵️
- Host: GitHub
- URL: https://github.com/metarhia/metawatch
- Owner: metarhia
- License: mit
- Created: 2020-09-27T20:42:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-24T22:45:53.000Z (over 2 years ago)
- Last Synced: 2024-04-14T12:01:36.432Z (about 2 years ago)
- Topics: impress, isolate, isolation, metarhia, nodejs, sandbox, sandboxing, v8, vm
- Language: JavaScript
- Homepage: https://metarhia.com
- Size: 227 KB
- Stars: 15
- Watchers: 13
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
- Authors: AUTHORS
Awesome Lists containing this project
README
# Deep nested directories watch for node.js
[](https://github.com/metarhia/metawatch/actions?query=workflow%3A%22Testing+CI%22+branch%3Amaster)
[](https://snyk.io/test/github/metarhia/metawatch)
[](https://badge.fury.io/js/metawatch)
[](https://www.npmjs.com/package/metawatch)
[](https://www.npmjs.com/package/metawatch)
[](https://github.com/metarhia/metawatch/blob/master/LICENSE)
- Watch directories recursive
- Rebuild recursive when new directories found or old directories remove
- Deduplicate events with debounce
## Usage
```js
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
- See github for full [contributors list](https://github.com/metarhia/metawatch/graphs/contributors)
## License & Contributors
Copyright (c) 2020-2024 [Metarhia contributors](https://github.com/metarhia/metawatch/graphs/contributors).
Metawatch is [MIT licensed](./LICENSE).
Metawatch is a part of [Metarhia](https://github.com/metarhia) technology stack.