rosa_parse

Crates.iorosa_parse
lib.rsrosa_parse
version0.2.0
sourcesrc
created_at2020-10-15 21:04:50.044946
updated_at2020-10-15 23:28:57.381312
descriptionRosa parse is a command line utility to convert json, yaml or toml from stdin to json, yaml or toml to stdout.
homepage
repositoryhttps://github.com/oknozor/rosa-parse
max_upload_size
id300233
size16,020
Paul Delafosse (oknozor)

documentation

README

Rosa parse

Rosa parse is a command line utility to convert json, yaml or toml from stdin to json, yaml or toml to stdout.

Installation

cargo install rosa_parse

Usage

Rosa parse is composed of three binaries :to-toml, to-yaml, to-json.

They take no arguments and expect json, yaml or toml from stdin.

Assuming we have the following json file :

{
    "fruits": [
        "apple",
        "banana"
    ]
}

You could convert it to any format :

  • to toml :

    ❯ to-toml < fruits.json
    fruits = ["apple", "banana"]
    
  • to yaml :

    ❯ to-yaml < fruits.json
    ---
    fruits:
      - apple
      - banana
    
  • back to json :

    ❯ to-json < fruits.json               
    {
      "fruits": [
        "apple",
        "banana"
      ]
    }
    
  • to yaml and then to toml

    ❯ cat fruits.json | to-yaml | to-toml 
    fruits = ["apple", "banana"]
    

Licence

All the code in this repository is released under the MIT License, for more information take a look at the LICENSE file.

Commit count: 10

cargo fmt