Skip to content

Commit cd68e35

Browse files
lib: deprecate _stream_* modules
PR-URL: #58337 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mattias Buelens <mattias@buelens.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
1 parent 1a5ab96 commit cd68e35

13 files changed

+81
-10
lines changed

doc/api/deprecations.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3920,6 +3920,21 @@ Type: Runtime
39203920
The `node:_tls_common` and `node:_tls_wrap` modules are deprecated as they should be considered
39213921
an internal nodejs implementation rather than a public facing API, use `node:tls` instead.
39223922

3923+
### DEP0193: `require('node:_stream_*')`
3924+
3925+
<!-- YAML
3926+
changes:
3927+
- version: REPLACEME
3928+
pr-url: https://github.com/nodejs/node/pull/58337
3929+
description: Runtime deprecation.
3930+
-->
3931+
3932+
Type: Runtime
3933+
3934+
The `node:_stream_duplex`, `node:_stream_passthrough`, `node:_stream_readable`, `node:_stream_transform`,
3935+
`node:_stream_wrap` and `node:_stream_writable` modules are deprecated as they should be considered
3936+
an internal nodejs implementation rather than a public facing API, use `node:stream` instead.
3937+
39233938
[DEP0142]: #dep0142-repl_builtinlibs
39243939
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
39253940
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3

lib/_stream_duplex.js

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

3-
// Keep this file as an alias for the full stream module.
4-
53
module.exports = require('stream').Duplex;
4+
5+
process.emitWarning('The _stream_duplex module is deprecated.',
6+
'DeprecationWarning', 'DEP0193');

lib/_stream_passthrough.js

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

3-
// Keep this file as an alias for the full stream module.
4-
53
module.exports = require('stream').PassThrough;
4+
5+
process.emitWarning('The _stream_passthrough module is deprecated.',
6+
'DeprecationWarning', 'DEP0193');

lib/_stream_readable.js

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

3-
// Keep this file as an alias for the full stream module.
4-
53
module.exports = require('stream').Readable;
4+
5+
process.emitWarning('The _stream_readable module is deprecated.',
6+
'DeprecationWarning', 'DEP0193');

lib/_stream_transform.js

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

3-
// Keep this file as an alias for the full stream module.
4-
53
module.exports = require('stream').Transform;
4+
5+
process.emitWarning('The _stream_transform module is deprecated.',
6+
'DeprecationWarning', 'DEP0193');

lib/_stream_wrap.js

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

33
module.exports = require('internal/js_stream_socket');
4+
45
process.emitWarning('The _stream_wrap module is deprecated.',
56
'DeprecationWarning', 'DEP0125');

lib/_stream_writable.js

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

3-
// Keep this file as an alias for the full stream module.
4-
53
module.exports = require('stream').Writable;
4+
5+
process.emitWarning('The _stream_writable module is deprecated.',
6+
'DeprecationWarning', 'DEP0193');
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
// _stream_duplex is deprecated.
6+
7+
common.expectWarning('DeprecationWarning',
8+
'The _stream_duplex module is deprecated.', 'DEP0193');
9+
10+
require('_stream_duplex');
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
// _stream_passthrough is deprecated.
6+
7+
common.expectWarning('DeprecationWarning',
8+
'The _stream_passthrough module is deprecated.', 'DEP0193');
9+
10+
require('_stream_passthrough');
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
// _stream_readable is deprecated.
6+
7+
common.expectWarning('DeprecationWarning',
8+
'The _stream_readable module is deprecated.', 'DEP0193');
9+
10+
require('_stream_readable');

0 commit comments

Comments
 (0)