Cody Casterline: Post

Cody Casterline

TableStream

So, working on FeoBlog, I wanted to print some data into a table in a terminal, and I was picky about how I wanted to do so, so I wrote my own.

In particular, I wanted to be able to:

  • Stream data without worrying about how much memory it'll use.
  • Let the table formatter
    • Pick column sizes
    • truncate data
    • align data.
    • choose a table width based on the size of the data and/or the terminal window.

The existing ones I found on crates.io required holding the table in memory.

So I just wrote my own:

https://github.com/NfNitLoop/tablestream

tablestream.gif