tiny_update_notifier 2.0.0

Tiny update notifier utility for rust cli programs
Documentation

Checks for update on program launch if more than 24h have passed since the last check, then pops up a notification if a new version was found 📢

supports crates.io and github releases

App Screenshot

Installation

Install tiny_update_notifier using Cargo

  cargo add tiny_update_notifier

Usage

Multi-threaded / Concurrent / Non-blocking / Asynchronous :
// check on crates.io
tiny_update_notifier::check_cratesIO(pkg_version, pkg_name);

// check on github releases
tiny_update_notifier::check_github(pkg_version, pkg_name, pkg_repo_url);
Single-threaded / Nonparallel / blocking / Synchronous :
tiny_update_notifier::Notifier::new().run(
    tiny_update_notifier::Source,
    pkg_version,
    pkg_name,
    pkg_repo_url
);

Examples

// Spawns a thread to check for updates on Crates.io and notify user if there is a new version available.
use tiny_update_notifier::check_cratesIO;

fn main() {
    check_cratesIO(
        env!("CARGO_PKG_VERSION"),
        env!("CARGO_PKG_NAME"),
    );
}
// Spawns a thread to check for updates on GitHub Releases and notify user if there is a new version available.
use tiny_update_notifier::check_github;

fn main() {
    check_github(
        env!("CARGO_PKG_VERSION"),
        env!("CARGO_PKG_NAME"),
        env!("CARGO_PKG_REPOSITORY"),
    );
}
// equivalent to the code above
use std::thread;
use tiny_update_notifier::{Notifier, Source};

fn main() {
    thread::spawn(|| {
        Notifier::new(
            Source::Github,
            env!("CARGO_PKG_VERSION"),
            env!("CARGO_PKG_NAME"),
            env!("CARGO_PKG_REPOSITORY"),
        )
        .run();
    });
}

Used by https://github.com/Araxeus/ls-interactive/