| Crates.io | ron2json |
| lib.rs | ron2json |
| version | 1.0.0 |
| created_at | 2025-12-21 19:03:29.348115+00 |
| updated_at | 2025-12-25 18:04:23.282513+00 |
| description | Convert ron files to json, yaml, or toml or vice versa |
| homepage | |
| repository | https://github.com/weezy20/r2 |
| max_upload_size | |
| id | 1998450 |
| size | 34,477 |
r2 is a program inter-convert ron <> [json | yaml | toml] files. Usually languages outside rust don't have a native parser for ron files as ron is designed with Rust in mind. r2 steps in to allow you to use ron files in projects that don't understand ron. You can also use r2 to convert a ron file out of json, yaml, or toml files.
The following crates enable transcoding to the supported target formats:
serde_jsonserde_yaml_bwtoml-rs/tomlron-rs/roncargo install ron2json # installs an executable named r2
r2 <path/to/file> <?options>
# --type | -t json|yaml|toml|yml|ron - specify output type
# --output | -o <path> - specify output path. Path may be a directory or file name.
# --force | -f - overwrite existing files. If -o <path> exists and is a file pass -f to overwrite. Default is disabled so overwrites fail.
r2 test.ron # Creates test.json in current working directory
r2 test.ron -o foo # Creates foo.json in current working directory otherwise if directory foo exists, creates foo/test.json (Preserving name from ron file, treating -o <arg> as directory)
r2 test.ron -t yml # Creates test.yml in current working directory. Can also be specified as -t yaml
r2 test.ron -o test.toml -t toml # Creates test.toml in current working directory
r2 test.json -t ron # Creates test.ron from test.json