JSON
JSON is a json specialized tool to write json files in a more readable way.
Installation
To install json, you need to have cargo installed.
Then, you can install json with the following command:
Usage
To use json, you need to add the following line to your code:
use JsonEditor;
Then, you can create a json object with the following syntax:
let mut json = open_from_file.expect;
After it, you can edit the json object with the following syntax:
json.add_key.expect;
json.add_key.expect;
json.add_key.expect;
json.add_key.expect;
Finally, you can save the json object with the following syntax:
json.save_to_file.expect;
You can also read the json object with the following syntax:
let mut json = open_from_file.expect;
let values = json.json_data.as_object.expect;
The values will be a &Map<String, Value>.
But you can also get it as Vec with the following syntax:
json.json_data.as_vec.expect;
The value will be an Option<&Vec<Value>>.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
json is licensed under the MIT license.