Skip to content

Commit 1e6ac2d

Browse files
lib: deprecate _stream_* modules
1 parent b197355 commit 1e6ac2d

13 files changed

+82
-10
lines changed

doc/api/deprecations.md

+15
Original file line numberDiff line numberDiff line change
@@ -3918,6 +3918,21 @@ Type: Runtime
39183918
The `node:_tls_common` and `node:_tls_wrap` modules are deprecated as they should be considered
39193919
an internal nodejs implementation rather than a public facing API, use `node:tls` instead.
39203920

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

lib/_stream_duplex.js

+3-2
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

+3-2
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

+3-2
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

+3-2
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

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
// TODO: check all the exports specifically
34
module.exports = require('internal/js_stream_socket');
5+
46
process.emitWarning('The _stream_wrap module is deprecated.',
57
'DeprecationWarning', 'DEP0125');

lib/_stream_writable.js

+3-2
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');
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');
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');
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');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
// _stream_transform is deprecated.
6+
7+
common.expectWarning('DeprecationWarning',
8+
'The _stream_transform module is deprecated.', 'DEP0193');
9+
10+
require('_stream_transform');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
// _stream_writable is deprecated.
6+
7+
common.expectWarning('DeprecationWarning',
8+
'The _stream_writable module is deprecated.', 'DEP0193');
9+
10+
require('_stream_writable');

0 commit comments

Comments
 (0)