Repository navigation
fs: add support for async iterators to fs.writeFile #38075
Description
Activity
- changed the title
[-]fs: writeFile support AsyncIterable, Iterable & Stream as data argument (regular fs version)[/-][+]fs: add support for async iterators to `fs.writeFile`[/+]on Apr 4, 2021 If #37948 lands, I think we shouldn't add features to the callback API.
And even if it doesn't land, I would advice to focus on other part of the codebase that needs improvement: users who want to use async iterators with a callback API can useutil.callbackify. That being said, I wouldn't block if a PR was sent with an implementation, I just don't think it's necessary.Reacted by linkgoron, Darshan Sen, Hiroyuki Yagihashi and Théo LUDWIG- addedfsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.questionIssues asking questions about Node.js.Issues asking questions about Node.js.
on Apr 4, 2021 I would be +1 and would be happy to help you collaborate on this regardless of the callback APIs status of legacy yes/no.
It would probably make sense for consistency IMO.
Reacted by Hiroyuki Yagihashiif the async iterator is able to write plain uint8array instead of relying on the buffer, then yes +1
@jimmywarting are there any FS APIs that require
Buffers and don't take "regular"Uint8Arrays?@benjamingr Hmm, maybe in the old days, things might have changed for the better now :)
remember that i could write a uint8array cuz it wasn't a buffer - this seems to no longer be the case
github-actions commented
on Jun 27, 2026 on Jun 27, 2026 – with GitHub ActionsContributorMore actionsThis issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jun 27, 2026 github-actions commented
on Jul 28, 2026 on Jul 28, 2026 – with GitHub ActionsContributorMore actionsThis issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
I'm curious too, so I made it an issue.
If necessary, I would like to handle it.