diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 60151401fb2..dbd9e8648c6 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2349,6 +2349,19 @@ Type: Runtime This property is a reference to the instance itself. + +### DEP0XXX: require('\_stream\_wrap') + + +Type: Runtime + +The `_stream_wrap` module is deprecated. + [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size [`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array diff --git a/lib/_stream_wrap.js b/lib/_stream_wrap.js index 5b5f476948b..227548e59db 100644 --- a/lib/_stream_wrap.js +++ b/lib/_stream_wrap.js @@ -1,3 +1,5 @@ 'use strict'; module.exports = require('internal/js_stream_socket'); +process.emitWarning('The _stream_wrap module is deprecated.', + 'DeprecationWarning', 'DEP0XXX'); diff --git a/test/parallel/test-warn-stream-wrap.js b/test/parallel/test-warn-stream-wrap.js new file mode 100644 index 00000000000..ffc2c510d0a --- /dev/null +++ b/test/parallel/test-warn-stream-wrap.js @@ -0,0 +1,10 @@ +'use strict'; + +const common = require('../common'); + +// _stream_wrap is deprecated. + +common.expectWarning('DeprecationWarning', + 'The _stream_wrap module is deprecated.', 'DEP0XXX'); + +require('_stream_wrap');