🧐 A simple file watcher, based on notify
, designed to be fast, easy-to-use and async friendly.
Project is alpha, it may fail at any given moment, heavily WIP
Negahban(نگهبان) is a farsi word which translates roughly to watchman/sentinel
negahban
is a Rust library based on notify
that allows you to watch a directory for changes.
This library is designed to be:
HookType
, WatchMode
, and RecurseMode
configuration options.Add this to your Cargo.toml
:
toml
[dependencies]
negahban = "x.x.x" # last semver instead of x.x.x
A minimal example that monitors the current directory and logs events to the console:
```rust use negahban::Negahban;
fn main() { Negahban{ // fields you want to change e.g.: hook: Box::new(|event, _| (println!("{:#?}", event))), ..Negahban::default() // sets rest of them to default }.watch(); } ```
See the examples/
directory for more examples.
This project is licensed under the MIT License - see the LICENSE file for details.