Skip to content

Commit eeea3fb

Browse files
gntemTrott
authored andcommitted
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent ceace1f commit eeea3fb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/internal/fs/streams.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ function ReadStream(path, options) {
6161
options.highWaterMark = 64 * 1024;
6262

6363
// For backwards compat do not emit close on destroy.
64-
options.emitClose = false;
64+
if (options.emitClose === undefined) {
65+
options.emitClose = false;
66+
}
6567

6668
Readable.call(this, options);
6769

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

239241
// For backwards compat do not emit close on destroy.
240-
options.emitClose = false;
242+
if (options.emitClose === undefined) {
243+
options.emitClose = false;
244+
}
241245

242246
Writable.call(this, options);
243247

0 commit comments

Comments
 (0)