Skip to content

Commit 328a2c7

Browse files
BridgeARMylesBorins
authored andcommitted
stream: lazy load end-of-stream
PR-URL: #20567 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
1 parent bc6dbc3 commit 328a2c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/streams/pipeline.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
'use strict';
55

6-
const eos = require('internal/streams/end-of-stream');
6+
let eos;
77

88
const {
99
ERR_MISSING_ARGS,
@@ -33,6 +33,7 @@ function destroyer(stream, reading, writing, callback) {
3333
closed = true;
3434
});
3535

36+
if (eos === undefined) eos = require('internal/streams/end-of-stream');
3637
eos(stream, { readable: reading, writable: writing }, (err) => {
3738
if (err) return callback(err);
3839
closed = true;

0 commit comments

Comments
 (0)