All Projects → ctron → colored_json

ctron / colored_json

Licence: EPL-2.0 license
Generating colored JSON in Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to colored json

log-utils
Basic logging utils: colors, symbols and timestamp.
Stars: ✭ 24 (+41.18%)
Mutual labels:  color, ansi-colors
Mordant
Full-featured text styling for Kotlin command-line applications
Stars: ✭ 382 (+2147.06%)
Mutual labels:  color, ansi-colors
line
An easy to use golang package for stylizing terminal output
Stars: ✭ 26 (+52.94%)
Mutual labels:  color, ansi-colors
colr
Easy terminal colors, with chainable methods.
Stars: ✭ 32 (+88.24%)
Mutual labels:  color, ansi-colors
material-design-color-palette
🎨Material Design color palette pluin for IntelliJ based IDEs.
Stars: ✭ 19 (+11.76%)
Mutual labels:  color
vim-yami
Monochromatic dark(闇) theme for Vim
Stars: ✭ 58 (+241.18%)
Mutual labels:  color
thayer-bright-iTerm
No description or website provided.
Stars: ✭ 29 (+70.59%)
Mutual labels:  color
zcolors
🌈 Z Colors uses your $LS_COLORS to generate a coherent theme for Git and your Zsh prompt, command line and completions.
Stars: ✭ 38 (+123.53%)
Mutual labels:  color
logt
🖥️ A colourful logger for the browser
Stars: ✭ 35 (+105.88%)
Mutual labels:  color
ink-color-pipe
🌈 Create color text with simpler style strings in Ink
Stars: ✭ 18 (+5.88%)
Mutual labels:  color
colortest
Quickly show all your terminal colors
Stars: ✭ 66 (+288.24%)
Mutual labels:  color
TerminalConsoleAppender
JLine 3 appender for Log4j2, allows extending command line apps using colors and command completion
Stars: ✭ 49 (+188.24%)
Mutual labels:  ansi-colors
tasarimcilar-ve-yazilimcilar-icin-kaynak-arsivim
Tasarım ve yazılım ile ilgili 2017 yılından günümüze kadar geçen zamanda toplamış olduğum arşivimi sizle ile paylaşıyorum. Ne mi var her şey...
Stars: ✭ 276 (+1523.53%)
Mutual labels:  color
Lano-Visualizer
A simple but highly configurable visualizer with rounded bars.
Stars: ✭ 114 (+570.59%)
Mutual labels:  color
color
Standard representation of colors, encouraging sharing between packages.
Stars: ✭ 23 (+35.29%)
Mutual labels:  color
Drawing
Drawing and fill color
Stars: ✭ 37 (+117.65%)
Mutual labels:  color
hex-to-css-filter
Easy way to generate colors from HEX to CSS Filters
Stars: ✭ 20 (+17.65%)
Mutual labels:  color
colo
Displays colors in various color spaces.
Stars: ✭ 60 (+252.94%)
Mutual labels:  color
ColorRatingBar
change color of star in rating bar
Stars: ✭ 23 (+35.29%)
Mutual labels:  color
termshot
Creates screenshots based on terminal command output
Stars: ✭ 114 (+570.59%)
Mutual labels:  ansi-colors

Colored JSON output for Rust Travis (.org) Crates.io

Also see:

Screenshot

Using

Add it to your project:

[dependencies]
colored_json = "2"

And then color your JSON output:

extern crate colored_json;

use colored_json::prelude::*;

fn main() -> ::std::result::Result<(), Box<::std::error::Error>> {
    println!(
        "{}",
        r#"
    {
        "array": [
            "ele1",
            "ele2"
        ],
        "float": 3.1415926,
        "integer": 4398798674962568,
        "string": "string"
    }
    "#.to_colored_json_auto()?
    );
    Ok(())
}

Or directly write it out:

extern crate serde_json;
extern crate colored_json;
use serde_json::{from_str, Value};
use std::io::stdout;
use std::io::Write;

pub fn main() -> ::std::result::Result<(), Box<::std::error::Error>> {
    let value: Value = from_str(r#"
        {
            "array": [
                "ele1",
                "ele2"
            ],
            "float": 3.1415926,
            "integer": 4398798674962568,
            "string": "string"
        }
    "#)?;
    let out = stdout();
    {
        let mut out = out.lock();
        colored_json::write_colored_json(&value, &mut out)?;
        out.flush()?;
    }
    Ok(())
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].