termcolor-json

Crates.iotermcolor-json
lib.rstermcolor-json
version1.0.0
sourcesrc
created_at2021-08-09 22:29:56.084078
updated_at2022-01-01 01:36:18.949048
descriptionA library for writing colored JSON output to a termcolor terminal.
homepage
repositoryhttps://github.com/andrewhickman/termcolor-json
max_upload_size
id433998
size24,765
Andrew Hickman (andrewhickman)

documentation

https://docs.rs/termcolor-json

README

Crates.io Docs.rs

termcolor-json

A library for writing colored JSON output to a termcolor terminal.

let stdout = StandardStream::stdout(ColorChoice::Auto);

termcolor_json::to_writer(
    &mut stdout.lock(),
    &serde_json::json!({
        "string": "value",
        "number": 123,
        "bool": true,
        "null": null,
    }),
)?;

Sample image

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 25

cargo fmt