tiny-update-check
A minimal, lightweight crate update checker for Rust CLI applications.
Why?
Existing update checker crates add significant binary bloat:
| Crate | Binary Impact |
|---|---|
| tiny-update-check | ~0.5MB |
| update-informer | ~1.4MB |
| updates | ~1.8MB |
This crate achieves minimal size by:
- Using
native-tls(system TLS) instead of bundling rustls - Minimal JSON parsing (string search instead of serde)
- Simple file-based caching
Installation
[]
= "0.1"
For pure-Rust TLS (larger binary, but better cross-compilation):
[]
= { = "0.1", = false, = ["rustls"] }
Usage
Simple
use check;
With Configuration
use UpdateChecker;
use Duration;
Disable Caching
use UpdateChecker;
use Duration;
let checker = new
.cache_duration; // Always fetch fresh
Features
native-tls(default) - Uses system TLS libraries, smaller binaryrustls- Pure Rust TLS, no system dependencies
How It Works
- Checks cache file (
~/.cache/<crate>-update-check) for recent version info - If cache is stale (default: 24 hours), queries crates.io API
- Compares versions using semver
- Returns
Some(UpdateInfo)if newer version exists
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.