Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Stream as source in Promises writeFile #1068

Closed
SoulKa opened this issue Oct 10, 2024 · 1 comment · Fixed by #1069
Closed

Support Stream as source in Promises writeFile #1068

SoulKa opened this issue Oct 10, 2024 · 1 comment · Fixed by #1069
Labels

Comments

@SoulKa
Copy link
Contributor

SoulKa commented Oct 10, 2024

Currently, it is not possible to write a stream to file using writeFile() from the Promises API. However, this is supported by the Node.js Promises API.

Since the callback API does not support writing streams to file, only the promises API needs to be adjusted. I suggest collecting the stream data into a buffer at FsPromises.ts in writeFile(). This would only change the promises API and make it compliant to the Node.js Promises API.

SoulKa added a commit to SoulKa/memfs that referenced this issue Oct 10, 2024
@SoulKa SoulKa changed the title Support Stream as source in async writeFile Support Stream as source in Promises writeFile Oct 10, 2024
SoulKa added a commit to SoulKa/memfs that referenced this issue Oct 10, 2024
SoulKa added a commit to SoulKa/memfs that referenced this issue Oct 10, 2024
Copy link

🎉 This issue has been resolved in version 4.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant