Skip to content

Slightly improve module deprecation warnings #58442

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

Closed
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
2 changes: 1 addition & 1 deletion lib/_stream_duplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion lib/_stream_passthrough.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion lib/_stream_transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion lib/_stream_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion lib/_stream_writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion lib/_tls_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion lib/sys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion test/parallel/test-warn-stream-duplex-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion test/parallel/test-warn-stream-passthrough-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion test/parallel/test-warn-stream-readable-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion test/parallel/test-warn-stream-transform-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion test/parallel/test-warn-stream-wrap-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion test/parallel/test-warn-stream-writable-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion test/parallel/test-warn-tls-common-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
2 changes: 1 addition & 1 deletion test/parallel/test-warn-tls-wrap-deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Loading