Crates.io | nya |
lib.rs | nya |
version | 1.0.0 |
source | src |
created_at | 2018-06-02 12:15:06.966948 |
updated_at | 2018-09-21 18:46:45.806232 |
description | A simple and small file processor. |
homepage | https://github.com/coll/nya |
repository | https://github.com/coll/nya |
max_upload_size | |
id | 68200 |
size | 51,056 |
nya
is a small and cute file processor. It does only what you want it to do, and nothing else.
cargo add nya
Install cargo-edit to extend Cargo, allowing you to add, remove, and upgrade dependencies by modifying your Cargo.toml file from the command line.
You'd use nya
somewhat like this:
extern crate nya;
use nya::{ignore, create_middleware};
fn main() {
nya::run(vec![
ignore(vec!["target/", ".DS_Store"]),
create_middleware(|files| {
let file = &mut files[0];
file.content = "test hello".to_string();
}, Some("source"), Some("destination"))
]).unwrap()
}
This reads all files from a directory, and replaces the content of the first one with "test hello". Full documentation can be found on docs.rs.
Licensed under the AGPL-3.0+. See LICENSE.