-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
fs: add stream utilities to FileHandle
#40009
Conversation
Co-authored-by: James M Snell <jasnell@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
207df82
to
ab59886
Compare
* @param {{ | ||
* encoding?: string; | ||
* autoClose?: boolean; | ||
* emitClose?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove autoClose & emitClose from here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are legacy. The only reason we have still have them is to avoid breakage. Since this is a new API they are not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s a new way for exposing the same old API, removing it would be harder than keeping it – also I don’t think they’re documented as legacy anywhere, so that’s probably best to leave that discussion for another PR.
* @param {{ | ||
* encoding?: string; | ||
* autoClose?: boolean; | ||
* emitClose?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove autoClose & emitClose from here?
/cc @nodejs/fs |
PR-URL: #40009 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 026bd82 |
PR-URL: #40009 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
@aduh95 do you mind opening a backport PR to |
PR-URL: nodejs#40009 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#40009 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Adding
filehandle.createReadStream
andfilehandle.createWriteStream
methods toFileHandle
class. This is useful to be able createReadStream
orWriteStream
fromfs/promises
.It also accept the same functions as
fs.createReadStream
andfs.createWriteStream
respectively: