bun icon indicating copy to clipboard operation
bun copied to clipboard

Bun Shell $: line by line stderr output

Open DavertMik opened this issue 1 year ago • 0 comments

What is the problem this feature would solve?

Many processes like docker build or npm run build print output to stderr. To collect realtime stdout inside Bun Shell I can use

for await (let line of $`docker build`.lines()) {

However, these lines don't include stderr. It would be nice to receive stderr output as it can be as valuable as stdout

What is the feature you are proposing to solve the problem?

lines method can take options what output to handle

for await (let line of $`docker build`.lines({  stdout: true, stderr: true })) {

What alternatives have you considered?

Using pipes or using Bun.spawn but I prefer to see this as part of Bun Shell because I really like this feature

DavertMik avatar Feb 12 '24 01:02 DavertMik