#cli

liveterm

Simple live-updating output for CLI apps

3 releases (breaking)

0.3.0 Jun 27, 2021
0.2.0 Feb 1, 2021
0.1.0 Feb 1, 2021

#2681 in #cli

Download history 729/week @ 2024-07-19 657/week @ 2024-07-26 339/week @ 2024-08-02 367/week @ 2024-08-09 491/week @ 2024-08-16 394/week @ 2024-08-23 396/week @ 2024-08-30 332/week @ 2024-09-06 274/week @ 2024-09-13 409/week @ 2024-09-20 264/week @ 2024-09-27 191/week @ 2024-10-04 268/week @ 2024-10-11 322/week @ 2024-10-18 472/week @ 2024-10-25 323/week @ 2024-11-01

1,404 downloads per month
Used in 3 crates

Unlicense

9KB
146 lines

Liveterm

Print stuff to the terminal, remove it, repeat!

Here's how to use it:

let mut tp = TermPrinter::new(std::io::stdout());
for i in 0..10 {
    tp.clear()?;              // clear what we draw last time
    tp.buf.clear();           // clear the buffer
    write!(tp.buf, "{}", i)?; // fill the buffer
    tp.print()?;              // draw the buffer
}

lib.rs:

Print stuff to the terminal, remove it, repeat!

Here's how to use it:

use liveterm::TermPrinter;
use std::fmt::Write;
let mut tp = TermPrinter::new(std::io::stdout());
for i in 0..10 {
tp.clear()?;              // clear what we draw last time
tp.buf.clear();           // clear the buffer
write!(tp.buf, "{}", i)?; // fill the buffer
tp.print()?;              // draw the buffer
}

Dependencies

~3.5MB
~59K SLoC