Expand description
Cargomon: A Rust implementation inspired by nodemon
This crate provides functionality to watch for file changes in a Rust project, automatically rebuild the project, and run the resulting executable.
§Features
- File watching: Monitors specified directories for changes
- Automatic rebuilding: Triggers a rebuild when changes are detected
- Executable running: Runs the built executable after a successful build
- Debouncing: Prevents multiple rebuilds for rapid successive file changes
- Colored output: Provides visually distinct console messages for better readability
§Usage
To use Cargomon in your project, add it as a dependency in your Cargo.toml:
[dependencies]
cargomon = "0.1.0"Then, in your main.rs file:
fn main() {
cargomon::run();
}§Command-line Options
Cargomon supports the following command-line options:
--watch-pathor-w: Specifies the directory to watch for changes (default: “.”)--debounce-secsor-d: Sets the debounce time in seconds (default: 2)
Example usage:
cargo run -- --watch-path ./src --debounce-secs 5Functions§
- run
- Starts the Cargomon file watcher and build/run loop.