Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewhickman/termcolor-json
A rust library for writing colored JSON output to a termcolor terminal.
https://github.com/andrewhickman/termcolor-json
rust
Last synced: 22 days ago
JSON representation
A rust library for writing colored JSON output to a termcolor terminal.
- Host: GitHub
- URL: https://github.com/andrewhickman/termcolor-json
- Owner: andrewhickman
- License: apache-2.0
- Created: 2021-08-09T22:28:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-01T01:35:38.000Z (about 3 years ago)
- Last Synced: 2024-11-20T02:32:55.995Z (about 2 months ago)
- Topics: rust
- Language: Rust
- Homepage:
- Size: 34.2 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
[![Crates.io][ci]][cl] [![Docs.rs][di]][dl]
[ci]: https://img.shields.io/crates/v/termcolor-json.svg
[cl]: https://crates.io/crates/termcolor-json/[di]: https://docs.rs/termcolor-json/badge.svg
[dl]: https://docs.rs/termcolor-json/# termcolor-json
A library for writing colored [JSON](https://crates.io/crates/serde_json) output to a [termcolor](https://crates.io/crates/termcolor) terminal.
```rust
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](img/sample.png)
## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)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.