Skip to content

Commit b996e3b

Browse files
mcollinadanielleadams
authored andcommitted
stream: do not use _stream_* anymore
Remove all leftover usage of _stream_* and keep all of them as legacy. We do not deprecate the old modules to avoid disrupition and ease maintainance. PR-URL: #36684 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 67dd48e commit b996e3b

22 files changed

+40
-40
lines changed

lib/_stream_duplex.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
// TODO(mcollina): deprecate this file
3+
// Keep this file as an alias for the full stream module.
44

5-
const Duplex = require('internal/streams/duplex');
6-
module.exports = Duplex;
5+
module.exports = require('stream').Duplex;

lib/_stream_passthrough.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
// TODO(mcollina): deprecate this file
3+
// Keep this file as an alias for the full stream module.
44

5-
const PassThrough = require('internal/streams/passthrough');
6-
module.exports = PassThrough;
5+
module.exports = require('stream').PassThrough;

lib/_stream_readable.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
// TODO(mcollina): deprecate this file
3+
// Keep this file as an alias for the full stream module.
44

5-
const Readable = require('internal/streams/readable');
6-
module.exports = Readable;
5+
module.exports = require('stream').Readable;

lib/_stream_transform.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
// TODO(mcollina): deprecate this file
3+
// Keep this file as an alias for the full stream module.
44

5-
const Transform = require('internal/streams/transform');
6-
module.exports = Transform;
5+
module.exports = require('stream').Transform;

lib/_stream_writable.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
// TODO(mcollina): deprecate this file
3+
// Keep this file as an alias for the full stream module.
44

5-
const Writable = require('internal/streams/writable');
6-
module.exports = Writable;
5+
module.exports = require('stream').Writable;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
const assert = require('assert');
6+
const stream = require('stream');
7+
8+
// Verify that all individual aliases are left in place.
9+
10+
assert.strictEqual(stream.Readable, require('_stream_readable'));
11+
assert.strictEqual(stream.Writable, require('_stream_writable'));
12+
assert.strictEqual(stream.Duplex, require('_stream_duplex'));
13+
assert.strictEqual(stream.Transform, require('_stream_transform'));
14+
assert.strictEqual(stream.PassThrough, require('_stream_passthrough'));

test/parallel/test-stream-pipe-after-end.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
'use strict';
2323
const common = require('../common');
2424
const assert = require('assert');
25-
const Readable = require('_stream_readable');
26-
const Writable = require('_stream_writable');
25+
const { Readable, Writable } = require('stream');
2726

2827
class TestReadable extends Readable {
2928
constructor(opt) {

test/parallel/test-stream-pipe-needDrain.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
const common = require('../common');
44
const assert = require('assert');
5-
const Readable = require('_stream_readable');
6-
const Writable = require('_stream_writable');
5+
const { Readable, Writable } = require('stream');
76

87
// Pipe should pause temporarily if writable needs drain.
98
{

test/parallel/test-stream2-base64-single-char-read-end.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121

2222
'use strict';
2323
require('../common');
24-
const R = require('_stream_readable');
25-
const W = require('_stream_writable');
24+
const { Readable: R, Writable: W } = require('stream');
2625
const assert = require('assert');
2726

2827
const src = new R({ encoding: 'base64' });

test/parallel/test-stream2-basic.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
'use strict';
2323

2424
const common = require('../common');
25-
const R = require('_stream_readable');
26-
const W = require('_stream_writable');
25+
const { Readable: R, Writable: W } = require('stream');
2726
const assert = require('assert');
2827

2928
const EE = require('events').EventEmitter;

0 commit comments

Comments
 (0)