#watch #notify #events #file-watcher #os

watchit

An easy to use, cross-platform watcher for file changes

1 unstable release

0.1.0 May 10, 2024

#745 in Filesystem

Download history 104/week @ 2024-05-06 8/week @ 2024-05-13

112 downloads per month

MIT license

7KB
53 lines

WatchIt! 👁️

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.

Usage

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");

lib.rs:

WatchIt!

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.

Usage

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");

Dependencies

~1–12MB
~86K SLoC