ITADN

How can I progressively iterate over stdout lines with a custom delimiter

#1210OpenMaddyGuthridge 创建于 2025-10-26
M
MaddyGuthridgecommented
I am attempting to monitor progress of `HandBrakeCLI`, which outputs its progress delimited by `\r` instead of `\n`. Is there a way that I can choose a custom delimiter when [progressively iterating](https://github.com/sindresorhus/execa/blob/main/docs/lines.md#progressive-splitting) over the process's `stdout`? I am unable to find any docs on this, and the quick test I threw together seems to indicate that it is not easily possible. Currently, my workaround is to pipe the output through `tr '\r', '\n'`, but being able to do this directly with `execa` would make things much simpler.
4 条评论