diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index e8ea13ffbd6c26..641bcfb5c76a10 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2348,6 +2348,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 5b5f476948b23a..227548e59db59a 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 00000000000000..ffc2c510d0a3ef --- /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');