-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
writeFile
support AsyncIterable
, Iterable
& Stream
as data
argument
#37391
Labels
fs
Issues and PRs related to the fs subsystem / file system.
good first issue
Issues that are suitable for first-time contributors.
Comments
ronag
added
fs
Issues and PRs related to the fs subsystem / file system.
good first issue
Issues that are suitable for first-time contributors.
labels
Feb 16, 2021
ronag
changed the title
writeFile should take AsyncIterable, Iterable & Stream as data argument
writeFile should take AsyncIterable, Iterable & Stream as Feb 16, 2021
data
argument
ronag
changed the title
writeFile should take AsyncIterable, Iterable & Stream as
Feb 16, 2021
data
argumentwriteFile
support AsyncIterable
, Iterable
& Stream
as data
argument
Writing an iterable, async iterable and stream can be done something like this: const fsp = require('fs/promises')
const fileHandle = await fsp.open(filePath, flags)
try {
for await (const buf of data) {
if (signal?.aborted) {
throw new AbortedError()
}
await fileHandle.write(buf)
}
} finally {
await fileHandle.close()
} You could make a special version for stream which has better performance. |
I would like to work on this problem. |
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 17, 2021
…ata` argument Fixes: nodejs#37391
It requires internal implementation. |
@ronag |
yes, maybe it is already implemented? I didn't know. |
This is the code that I am implementing locally. I will continue with the implementation. |
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 21, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 21, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 21, 2021
…ta` argument Fixes: nodejs#37391
4 tasks
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 22, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 23, 2021
…ta` argument Fixes: nodejs#37391
4 tasks
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 23, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 23, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 23, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 23, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 23, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 23, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 24, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 24, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 24, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 24, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 28, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Feb 28, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 3, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 3, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 3, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 4, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 4, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 4, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 5, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 6, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 20, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 20, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Mar 28, 2021
…ta` argument Fixes: nodejs#37391
yagipy
pushed a commit
to yagipy/node
that referenced
this issue
Apr 3, 2021
…ta` argument Fixes: nodejs#37391
MylesBorins
pushed a commit
that referenced
this issue
Apr 4, 2021
Fixes: #37391 PR-URL: #37490 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
MylesBorins
pushed a commit
that referenced
this issue
Apr 5, 2021
Fixes: #37391 PR-URL: #37490 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
aduh95
pushed a commit
to aduh95/node
that referenced
this issue
Sep 1, 2021
Fixes: nodejs#37391 PR-URL: nodejs#37490 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
aduh95
pushed a commit
to aduh95/node
that referenced
this issue
Sep 1, 2021
Fixes: nodejs#37391 PR-URL: nodejs#37490 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
targos
pushed a commit
that referenced
this issue
Sep 4, 2021
Fixes: #37391 PR-URL: #37490 Backport-PR-URL: #39973 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: James M Snell <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
fs
Issues and PRs related to the fs subsystem / file system.
good first issue
Issues that are suitable for first-time contributors.
https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback
The text was updated successfully, but these errors were encountered: