Skip to content

lib: deprecate _stream_* modules #58337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3918,6 +3918,21 @@ Type: Runtime
The `node:_tls_common` and `node:_tls_wrap` modules are deprecated as they should be considered
an internal nodejs implementation rather than a public facing API, use `node:tls` instead.

### DEP0193: `require('node:_stream_*')`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/58337
description: Runtime deprecation.
-->

Type: Runtime

The `node:_stream_duplex`, `node:_stream_passthrough`, `node:_stream_readable`, `node:_stream_transform`,
`node:_stream_wrap` and `node:_stream_writable` modules are deprecated as they should be considered
an internal nodejs implementation rather than a public facing API, use `node:stream` instead.

[DEP0142]: #dep0142-repl_builtinlibs
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
Expand Down
5 changes: 3 additions & 2 deletions lib/_stream_duplex.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// Keep this file as an alias for the full stream module.

module.exports = require('stream').Duplex;

process.emitWarning('The _stream_duplex module is deprecated.',
'DeprecationWarning', 'DEP0193');
5 changes: 3 additions & 2 deletions lib/_stream_passthrough.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// Keep this file as an alias for the full stream module.

module.exports = require('stream').PassThrough;

process.emitWarning('The _stream_passthrough module is deprecated.',
'DeprecationWarning', 'DEP0193');
5 changes: 3 additions & 2 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// Keep this file as an alias for the full stream module.

module.exports = require('stream').Readable;

process.emitWarning('The _stream_readable module is deprecated.',
'DeprecationWarning', 'DEP0193');
5 changes: 3 additions & 2 deletions lib/_stream_transform.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// Keep this file as an alias for the full stream module.

module.exports = require('stream').Transform;

process.emitWarning('The _stream_transform module is deprecated.',
'DeprecationWarning', 'DEP0193');
1 change: 1 addition & 0 deletions lib/_stream_wrap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

module.exports = require('internal/js_stream_socket');

process.emitWarning('The _stream_wrap module is deprecated.',
'DeprecationWarning', 'DEP0125');
5 changes: 3 additions & 2 deletions lib/_stream_writable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// Keep this file as an alias for the full stream module.

module.exports = require('stream').Writable;

process.emitWarning('The _stream_writable module is deprecated.',
'DeprecationWarning', 'DEP0193');
10 changes: 10 additions & 0 deletions test/parallel/test-warn-stream-duplex-deprecation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

const common = require('../common');

// _stream_duplex is deprecated.

common.expectWarning('DeprecationWarning',
'The _stream_duplex module is deprecated.', 'DEP0193');

require('_stream_duplex');
10 changes: 10 additions & 0 deletions test/parallel/test-warn-stream-passthrough-deprecation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

const common = require('../common');

// _stream_passthrough is deprecated.

common.expectWarning('DeprecationWarning',
'The _stream_passthrough module is deprecated.', 'DEP0193');

require('_stream_passthrough');
10 changes: 10 additions & 0 deletions test/parallel/test-warn-stream-readable-deprecation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

const common = require('../common');

// _stream_readable is deprecated.

common.expectWarning('DeprecationWarning',
'The _stream_readable module is deprecated.', 'DEP0193');

require('_stream_readable');
10 changes: 10 additions & 0 deletions test/parallel/test-warn-stream-transform-deprecation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

const common = require('../common');

// _stream_transform is deprecated.

common.expectWarning('DeprecationWarning',
'The _stream_transform module is deprecated.', 'DEP0193');

require('_stream_transform');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file renamed for consistency with the others I'm adding

File renamed without changes.
10 changes: 10 additions & 0 deletions test/parallel/test-warn-stream-writable-deprecation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

const common = require('../common');

// _stream_writable is deprecated.

common.expectWarning('DeprecationWarning',
'The _stream_writable module is deprecated.', 'DEP0193');

require('_stream_writable');
Loading