Skip to content
/ negahban Public

🧐 A simple file watcher, based on `notify`, designed to be fast, easy-to-use and async friendly

License

Notifications You must be signed in to change notification settings

aarmn/negahban

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Negahban

🧐 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

MIT License Crates.io docs.rs

Name πŸ˜€

Negahban(Ω†Ϊ―Ω‡Ψ¨Ψ§Ω†) is a farsi word which translates roughly to watchman/sentinel

Overview πŸ“Š

negahban is a Rust library based on notify that allows you to watch a directory for changes.

This library is designed to be:

  • Simple, Sane defaults 🌱
  • Blazing Fast πŸš€
  • Async friendly πŸ”€
  • Cross-platform 🌐

Features ✨

  • Supports multiple event types such as file creation, deletion, and modification.
  • [WIP] Provides HookType, EventType, WatchMode, RecurseMode, WatcherMode configuration as simple to use enums.
  • Can ignore specific files and directories.
  • Easy to use and async friendly.

Usage πŸ”¨

Run this in your rust project folder:

cargo add negahban

A minimal example that monitors the current directory and logs events to the console:

use negahban::{Negahban, HookType};

fn main() {
    Negahban{
        // fields you want to change e.g.: 
        hook: HookType::IndefiniteHook(
            Box::new(|event| (println!("{event:#?}")))
        ),
        ..Negahban::default() // sets rest of them to default
    }.watch();
}

Examples πŸ‘¨β€πŸ’»

Check the tests/ directory for more examples.

License βš–

This project is licensed under the MIT License - see the LICENSE file for details.

About

🧐 A simple file watcher, based on `notify`, designed to be fast, easy-to-use and async friendly

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages