You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Print command output and get the output in results #51
I ha ve doubt, how can I run a long run command, for example docker build, print the logs on terminal but at the same time getting the complete output to be evaluated later?...
Case 1: const result = await exec('docker', ['buildx', 'build', '....'])
This works fine and I get the stderr, stdout, and exitCode inside result variable, and I can do a console log to print the output using console.log, but because the command takes a while, it's a bad experience because the user can't see the progress while the command runs...
Case 2: const res = await exec('docker', ['buildx', 'build', '....'], {nodeOptions: { stdio: 'inherit' }})
With stdio: 'inherit' I can see the progress in realtime but stderr and stdout are always empty strings in the result variable, so cannot be used for extra analysis of the output...
I want to print the progress in realtime but also get the complete output in the result variable... How can I do that?
Activity
43081j commentedon Jul 21, 2025
you could possibly just loop over the output: