Skip to content
Permalink
Browse files

fs: allow passing true to emitClose option

Allow passing true for emitClose option for fs
streams.

Fixes: #29177

PR-URL: #29212
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information...
gntem authored and BridgeAR committed Aug 19, 2019
1 parent 12cbb3f commit 8f47ff16d484fb949fb05bb8da2346a0d9d8ee33
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/internal/fs/streams.js
@@ -61,7 +61,9 @@ function ReadStream(path, options) {
options.highWaterMark = 64 * 1024;

// For backwards compat do not emit close on destroy.
options.emitClose = false;
if (options.emitClose === undefined) {
options.emitClose = false;
}

Readable.call(this, options);

@@ -237,7 +239,9 @@ function WriteStream(path, options) {
options = copyObject(getOptions(options, {}));

// For backwards compat do not emit close on destroy.
options.emitClose = false;
if (options.emitClose === undefined) {
options.emitClose = false;
}

Writable.call(this, options);

0 comments on commit 8f47ff1

Please sign in to comment.
You can’t perform that action at this time.