ink
ink copied to clipboard
How to pipe a subprocess' output?
Hi! This project seems amazing.
I have a use case where I want to build a CLI on top of lerna, so ideally I would like to be able to set a Box where the output is whatever lerna spits out.
Is there a recipe to do this with Ink?
Thank you!
I don't think you have to do anything special. Just save the stdout to an array or something & render it. The output from stdout
I think can be treated as data like anything else.
@mAAdhaTTah Thanks, I'll try that!
@cevr would be cool to see the result when you got it :)
@mAAdhaTTah is correct, as long as you get output text from the sub process, you can render it inside <Text>
.
@vadimdemedes What about preserving the output formating (like color)?
I think it should work too.