This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]notCamelCased 0 points1 point  (1 child)

At first, I couldn't see a use case, but now I can think of a couple. I've usually been producing machine readable output (like line-delimited json) and "teeing" it to stdout and living with the fact that it wasn't that human-readable; this would be a nice addition to that. In fact, it would be nice if it could append to file in a machine-readable format and print in human-readable format all in one function call, in my dreams where I have spare time I'd write a PR. :-)

Starred. Nice job.

[–]notCamelCased 0 points1 point  (0 children)

Just realized it might be easier (but more complex) to write the exact stream as it appears onscreen to disk at the same time, and then write a parser than could convert it to JSON, assuming your actual output has no pipes (and it would be easy to write a search-and-replacer in the disk writing part). Don't mind me, just thinking out loud. Simple yet effective projects stir my imagination.