From 9ce691fc993aa63e86868de09f12c3186ac88711 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 23 May 2025 23:03:02 +0100 Subject: [PATCH 1/2] lib: add module to use in module deprecation warnings --- lib/_stream_duplex.js | 2 +- lib/_stream_passthrough.js | 2 +- lib/_stream_readable.js | 2 +- lib/_stream_transform.js | 2 +- lib/_stream_wrap.js | 2 +- lib/_stream_writable.js | 2 +- lib/_tls_common.js | 2 +- lib/_tls_wrap.js | 2 +- test/parallel/test-warn-stream-duplex-deprecation.js | 2 +- test/parallel/test-warn-stream-passthrough-deprecation.js | 2 +- test/parallel/test-warn-stream-readable-deprecation.js | 2 +- test/parallel/test-warn-stream-transform-deprecation.js | 2 +- test/parallel/test-warn-stream-wrap-deprecation.js | 2 +- test/parallel/test-warn-stream-writable-deprecation.js | 2 +- test/parallel/test-warn-tls-common-deprecation.js | 2 +- test/parallel/test-warn-tls-wrap-deprecation.js | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js index 6b0cdb2d41403c..3dca7fee54e356 100644 --- a/lib/_stream_duplex.js +++ b/lib/_stream_duplex.js @@ -2,5 +2,5 @@ module.exports = require('stream').Duplex; -process.emitWarning('The _stream_duplex module is deprecated.', +process.emitWarning('The _stream_duplex module is deprecated. Use `node:stream` instead.', 'DeprecationWarning', 'DEP0193'); diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js index cb3d0b8d7b2098..9255ec40e7c347 100644 --- a/lib/_stream_passthrough.js +++ b/lib/_stream_passthrough.js @@ -2,5 +2,5 @@ module.exports = require('stream').PassThrough; -process.emitWarning('The _stream_passthrough module is deprecated.', +process.emitWarning('The _stream_passthrough module is deprecated. Use `node:stream` instead.', 'DeprecationWarning', 'DEP0193'); diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 38f1ab0a8ae4bb..8b7db04064001f 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -2,5 +2,5 @@ module.exports = require('stream').Readable; -process.emitWarning('The _stream_readable module is deprecated.', +process.emitWarning('The _stream_readable module is deprecated. Use `node:stream` instead.', 'DeprecationWarning', 'DEP0193'); diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index 2570a7544917ac..a62b4ae338cc3d 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -2,5 +2,5 @@ module.exports = require('stream').Transform; -process.emitWarning('The _stream_transform module is deprecated.', +process.emitWarning('The _stream_transform module is deprecated. Use `node:stream` instead.', 'DeprecationWarning', 'DEP0193'); diff --git a/lib/_stream_wrap.js b/lib/_stream_wrap.js index fc7a5ecdd7b961..710f3565c3e8b6 100644 --- a/lib/_stream_wrap.js +++ b/lib/_stream_wrap.js @@ -2,5 +2,5 @@ module.exports = require('internal/js_stream_socket'); -process.emitWarning('The _stream_wrap module is deprecated.', +process.emitWarning('The _stream_wrap module is deprecated. Use `node:stream` instead.', 'DeprecationWarning', 'DEP0125'); diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 6b9d5e24fde601..3cef06126e5f42 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -2,5 +2,5 @@ module.exports = require('stream').Writable; -process.emitWarning('The _stream_writable module is deprecated.', +process.emitWarning('The _stream_writable module is deprecated. Use `node:stream` instead.', 'DeprecationWarning', 'DEP0193'); diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 607875d43a11a8..cdbb40882204ec 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -6,5 +6,5 @@ module.exports = { createSecureContext, translatePeerCertificate, }; -process.emitWarning('The _tls_common module is deprecated.', +process.emitWarning('The _tls_common module is deprecated. Use `node:tls` instead.', 'DeprecationWarning', 'DEP0192'); diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 24bd9717281698..910278e40a4f0e 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -7,5 +7,5 @@ module.exports = { createServer, connect, }; -process.emitWarning('The _tls_wrap module is deprecated.', +process.emitWarning('The _tls_wrap module is deprecated. Use `node:tls` instead.', 'DeprecationWarning', 'DEP0192'); diff --git a/test/parallel/test-warn-stream-duplex-deprecation.js b/test/parallel/test-warn-stream-duplex-deprecation.js index bd6d885a3d0d1a..a52fb55d0b80a4 100644 --- a/test/parallel/test-warn-stream-duplex-deprecation.js +++ b/test/parallel/test-warn-stream-duplex-deprecation.js @@ -5,6 +5,6 @@ const common = require('../common'); // _stream_duplex is deprecated. common.expectWarning('DeprecationWarning', - 'The _stream_duplex module is deprecated.', 'DEP0193'); + 'The _stream_duplex module is deprecated. Use `node:stream` instead.', 'DEP0193'); require('_stream_duplex'); diff --git a/test/parallel/test-warn-stream-passthrough-deprecation.js b/test/parallel/test-warn-stream-passthrough-deprecation.js index 397c93686b20c9..6726aeb4d7346e 100644 --- a/test/parallel/test-warn-stream-passthrough-deprecation.js +++ b/test/parallel/test-warn-stream-passthrough-deprecation.js @@ -5,6 +5,6 @@ const common = require('../common'); // _stream_passthrough is deprecated. common.expectWarning('DeprecationWarning', - 'The _stream_passthrough module is deprecated.', 'DEP0193'); + 'The _stream_passthrough module is deprecated. Use `node:stream` instead.', 'DEP0193'); require('_stream_passthrough'); diff --git a/test/parallel/test-warn-stream-readable-deprecation.js b/test/parallel/test-warn-stream-readable-deprecation.js index cb8b3a01a7d38a..dbdc1702b59e60 100644 --- a/test/parallel/test-warn-stream-readable-deprecation.js +++ b/test/parallel/test-warn-stream-readable-deprecation.js @@ -5,6 +5,6 @@ const common = require('../common'); // _stream_readable is deprecated. common.expectWarning('DeprecationWarning', - 'The _stream_readable module is deprecated.', 'DEP0193'); + 'The _stream_readable module is deprecated. Use `node:stream` instead.', 'DEP0193'); require('_stream_readable'); diff --git a/test/parallel/test-warn-stream-transform-deprecation.js b/test/parallel/test-warn-stream-transform-deprecation.js index 7872d9ebf0cf2d..600cbcc1923b8a 100644 --- a/test/parallel/test-warn-stream-transform-deprecation.js +++ b/test/parallel/test-warn-stream-transform-deprecation.js @@ -5,6 +5,6 @@ const common = require('../common'); // _stream_transform is deprecated. common.expectWarning('DeprecationWarning', - 'The _stream_transform module is deprecated.', 'DEP0193'); + 'The _stream_transform module is deprecated. Use `node:stream` instead.', 'DEP0193'); require('_stream_transform'); diff --git a/test/parallel/test-warn-stream-wrap-deprecation.js b/test/parallel/test-warn-stream-wrap-deprecation.js index 837a6e880ba6d6..9146cbd6af1555 100644 --- a/test/parallel/test-warn-stream-wrap-deprecation.js +++ b/test/parallel/test-warn-stream-wrap-deprecation.js @@ -5,6 +5,6 @@ const common = require('../common'); // _stream_wrap is deprecated. common.expectWarning('DeprecationWarning', - 'The _stream_wrap module is deprecated.', 'DEP0125'); + 'The _stream_wrap module is deprecated. Use `node:stream` instead.', 'DEP0125'); require('_stream_wrap'); diff --git a/test/parallel/test-warn-stream-writable-deprecation.js b/test/parallel/test-warn-stream-writable-deprecation.js index a6e7e418f22f40..3a8765ca93d525 100644 --- a/test/parallel/test-warn-stream-writable-deprecation.js +++ b/test/parallel/test-warn-stream-writable-deprecation.js @@ -5,6 +5,6 @@ const common = require('../common'); // _stream_writable is deprecated. common.expectWarning('DeprecationWarning', - 'The _stream_writable module is deprecated.', 'DEP0193'); + 'The _stream_writable module is deprecated. Use `node:stream` instead.', 'DEP0193'); require('_stream_writable'); diff --git a/test/parallel/test-warn-tls-common-deprecation.js b/test/parallel/test-warn-tls-common-deprecation.js index 9d5d51c5f3d8d4..00ce2690a95676 100644 --- a/test/parallel/test-warn-tls-common-deprecation.js +++ b/test/parallel/test-warn-tls-common-deprecation.js @@ -6,6 +6,6 @@ if (!common.hasCrypto) common.skip('missing crypto'); // _tls_common is deprecated. common.expectWarning('DeprecationWarning', - 'The _tls_common module is deprecated.', 'DEP0192'); + 'The _tls_common module is deprecated. Use `node:tls` instead.', 'DEP0192'); require('_tls_common'); diff --git a/test/parallel/test-warn-tls-wrap-deprecation.js b/test/parallel/test-warn-tls-wrap-deprecation.js index 318b3fc738317a..53fc1e69830f99 100644 --- a/test/parallel/test-warn-tls-wrap-deprecation.js +++ b/test/parallel/test-warn-tls-wrap-deprecation.js @@ -6,6 +6,6 @@ if (!common.hasCrypto) common.skip('missing crypto'); // _tls_wrap is deprecated. common.expectWarning('DeprecationWarning', - 'The _tls_wrap module is deprecated.', 'DEP0192'); + 'The _tls_wrap module is deprecated. Use `node:tls` instead.', 'DEP0192'); require('_tls_wrap'); From 95e9c1a46a0744fdba362c688f5782ead5ec54e1 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 23 May 2025 23:04:16 +0100 Subject: [PATCH 2/2] lib: add `node:` prefix in sys module deprecation warning --- lib/sys.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sys.js b/lib/sys.js index 4606412dabc2ef..02bfaae2e7790f 100644 --- a/lib/sys.js +++ b/lib/sys.js @@ -27,5 +27,5 @@ // Note to maintainers: Although this module has been deprecated for a while // we do not plan to remove it. See: https://github.com/nodejs/node/pull/35407#issuecomment-700693439 module.exports = require('util'); -process.emitWarning('sys is deprecated. Use util instead.', +process.emitWarning('sys is deprecated. Use `node:util` instead.', 'DeprecationWarning', 'DEP0025');