Crates.io | watchit |
lib.rs | watchit |
version | 0.1.0 |
source | src |
created_at | 2024-05-10 13:19:28.274814 |
updated_at | 2024-05-10 13:19:28.274814 |
description | An easy to use, cross-platform watcher for file changes |
homepage | https://github.com/ciresnave/watchit |
repository | https://github.com/ciresnave/watchit |
max_upload_size | |
id | 1236005 |
size | 6,546 |
We've got our eyes on your files. WatchIt will run your callback when a file changes. It's easy to use and simple to understand. WatchIt is cross platform and works on Linux, BSD, Mac and Windows.
Add watchit to your cargo.toml:
[dependencies]
watchit = "0.1"
Create and instance of the Watcher with a callback:
let mut watcher = Watcher::new(|event| println!(event));
Add a file to be watched:
watcher.watch("file.txt");