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
Inside bun when running the below program the file contents being written are just the string [object EventEmitter] and not the actual OGG data. Im sure bun has a deficiency here with NodeJS streams.
Same for things like readable streams you'll see [object object]
easy to reproduce with this:
import*asfsfrom'fs/promises';import{Readable}from'stream';// Create a readable stream (for demonstration purposes)constexampleStream=Readable.from(['Hello, ','world!']);// Specify the file pathconstfilePath='output.txt';asyncfunctionwriteStreamToFile(readableStream,filePath){try{// Write the stream directly to the fileawaitfs.writeFile(filePath,readableStream);console.log('File written successfully');}catch(error){console.error('Error writing file:',error);}}// Write the stream to the filewriteStreamToFile(exampleStream,filePath);
What version of Bun is running?
1.1.10+5102a9443
What platform is your computer?
Linux 6.1.0-13-amd64 x86_64 unknown
What steps can reproduce the bug?
Inside
bun
when running the below program the file contents being written are just the string[object EventEmitter]
and not the actual OGG data. Im sure bun has a deficiency here with NodeJS streams.What is the expected behavior?
To properly write the data into the file, not just that string.
What do you see instead?
Additional information
It works perfectly in NodeJS.
The text was updated successfully, but these errors were encountered: