-
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
fs: streams emitClose #29177
Comments
hello tried to make this I see there are some backwards compatibility concerns how does this look ? diff --git a/lib/internal/fs/streams.js b/lib/internal/fs/streams.js
index dfff08dbbd..d8776598f7 100644
--- a/lib/internal/fs/streams.js
+++ b/lib/internal/fs/streams.js
@@ -65,7 +65,9 @@ function ReadStream(path, options) {
options.highWaterMark = 64 * 1024;
// For backwards compat do not emit close on destroy.
- options.emitClose = false;
+ if (typeof options.emitClose !== 'boolean') {
+ options.emitClose = false;
+ }
Readable.call(this, options);
@@ -241,7 +243,9 @@ function WriteStream(path, options) {
options = copyObject(getOptions(options, {}));
// For backwards compat do not emit close on destroy.
- options.emitClose = false;
+ if (typeof options.emitClose !== 'boolean') {
+ options.emitClose = false;
+ }
Writable.call(this, options);
|
instead of checking for typeof boolean I would check for undefined |
gntem
added a commit
to gntem/node
that referenced
this issue
Aug 19, 2019
Allow passing true for emitClose option for fs streams. Fixes: nodejs#29177
2 tasks
Fishrock123
added
stream
Issues and PRs related to the stream subsystem.
fs
Issues and PRs related to the fs subsystem / file system.
labels
Aug 19, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Allow passing emitClose: true to fs streams.
The text was updated successfully, but these errors were encountered: