#json #serde-json #color #console #ansi #serde

termcolor-json

A library for writing colored JSON output to a termcolor terminal

6 releases (1 stable)

1.0.0 Jan 1, 2022
0.1.4 Sep 23, 2021
0.1.2 Aug 15, 2021

#978 in Command-line interface

Download history 5/week @ 2024-07-13 1/week @ 2024-07-20 1/week @ 2024-08-31 15/week @ 2024-09-21 28/week @ 2024-09-28 25/week @ 2024-10-05 14/week @ 2024-10-12 9/week @ 2024-10-19 2/week @ 2024-10-26

55 downloads per month
Used in ryan-cli

MIT/Apache

23KB
519 lines

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.

Dependencies

~0.5–7.5MB
~57K SLoC