ko

Crates.ioko
lib.rsko
version1.0.3
sourcesrc
created_at2019-01-17 09:47:16.250508
updated_at2019-03-26 11:30:50.966033
descriptionA simple and small file processor.
homepagehttps://github.com/komaeda/ko
repositoryhttps://github.com/komaeda/ko
max_upload_size
id109112
size50,973
(komaeda)

documentation

https://docs.rs/ko

README

ko builds.sr.ht status

ko is a small and cute file processor. It does only what you want it to do, and nothing else.

Installation

Make sure you have Rust 2018 (Rust 1.31+) installed.

cargo add ko

Install cargo-edit to extend Cargo, allowing you to add, remove, and upgrade dependencies by modifying your Cargo.toml file from the command line.

Usage

You'd use ko somewhat like this:

use ko::{ignore, create_middleware};

fn main() {
  ko::run(vec![
    ignore(vec![String::from("target/")]),
    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.

License

Licensed under the AGPL-3.0+. See LICENSE.

Commit count: 98

cargo fmt