yansi alternatives and similar packages
Based on the "Style" category.
Alternatively, view yansi alternatives based on common mentions on social networks and blogs.
-
rust-ansi-term
Rust library for ANSI terminal colours and styles (bold, underline) -
term-painter
Cross-platform Rust library for coloring and formatting terminal output -
termstyle
create and test the style and formatting of text in your terminal applications
Clean code begins in your IDE with SonarLint
Do you think we are missing an alternative of yansi or a related project?
README
yansi
A dead simple ANSI terminal color painting library for Rust.
use yansi::Paint;
print!("{} light, {} light!", Paint::green("Green"), Paint::red("red").underline());
See the documentation for more.
Why?
Several terminal coloring libraries exist (ansi_term
, colored
,
term_painter
, to name a few), begging the question: why yet another? Here
are a few reasons:
- This library is much simpler: there are three types!
- Unlike
ansi_term
orcolored
, any type implementingDisplay
orDebug
can be stylized, not only strings. - Styling can be enabled and disabled globally, on the fly.
- Arbitrary items can be masked for selective disabling.
- Styling can wrap any arbitrarily styled item.
- Typically only one type needs to be imported:
Paint
. - Zero dependencies. It really is simple.
- The name
yansi
is pretty short.
All that being said, this library borrows API ideas from the three libraries as
well as implementation details from ansi_term
.
License
yansi
is licensed under either of the following, at your option:
- 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)
*Note that all licence references and agreements mentioned in the yansi README section above
are relevant to that project's source code only.