diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 63faf076262915..b6ec7fb721366f 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -590,6 +590,9 @@ Type: End-of-Life ### DEP0027: util.puts() -Type: Runtime +Type: End-of-Life -The [`util.puts()`][] API is deprecated. Please use [`console.log()`][] instead. +`util.puts()` has been removed. Please use [`console.log()`][] instead. ### DEP0028: util.debug() @@ -2413,7 +2416,6 @@ Setting the TLS ServerName to an IP address is not permitted by [`util.isSymbol()`]: util.html#util_util_issymbol_object [`util.isUndefined()`]: util.html#util_util_isundefined_object [`util.log()`]: util.html#util_util_log_string -[`util.puts()`]: util.html#util_util_puts_strings [`util.types`]: util.html#util_util_types [`util`]: util.html [`worker.exitedAfterDisconnect`]: cluster.html#cluster_worker_exitedafterdisconnect diff --git a/doc/api/util.md b/doc/api/util.md index db25a0be057d81..cdfaf4bdca9248 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -2167,16 +2167,6 @@ const util = require('util'); util.log('Timestamped message.'); ``` -### util.puts([...strings]) - - -> Stability: 0 - Deprecated: Use [`console.log()`][] instead. - -Deprecated predecessor of `console.log`. - [`'uncaughtException'`]: process.html#process_event_uncaughtexception [`'warning'`]: process.html#process_event_warning [`Array.isArray()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray @@ -2207,7 +2197,6 @@ Deprecated predecessor of `console.log`. [`WebAssembly.Module`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module [`assert.deepStrictEqual()`]: assert.html#assert_assert_deepstrictequal_actual_expected_message [`console.error()`]: console.html#console_console_error_data_args -[`console.log()`]: console.html#console_console_log_data_args [`target` and `handler`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#Terminology [`util.format()`]: #util_util_format_format_args [`util.inspect()`]: #util_util_inspect_object_options diff --git a/lib/util.js b/lib/util.js index e0f83efdba5660..1cb113bad10f9c 100644 --- a/lib/util.js +++ b/lib/util.js @@ -326,12 +326,6 @@ function _extend(target, source) { // Deprecated old stuff. -function puts(...args) { - for (var i = 0, len = args.length; i < len; ++i) { - process.stdout.write(`${args[i]}\n`); - } -} - function debug(x) { process.stderr.write(`DEBUG: ${x}\n`); } @@ -440,8 +434,5 @@ module.exports = exports = { 'DEP0028'), error: deprecate(error, 'util.error is deprecated. Use console.error instead.', - 'DEP0029'), - puts: deprecate(puts, - 'util.puts is deprecated. Use console.log instead.', - 'DEP0027') + 'DEP0029') }; diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 78d1f43f4a6ffd..54aaa4266f3bd6 100644 --- a/test/parallel/test-util.js +++ b/test/parallel/test-util.js @@ -145,12 +145,10 @@ assert.strictEqual(util.isFunction(), false); assert.strictEqual(util.isFunction('string'), false); common.expectWarning('DeprecationWarning', [ - ['util.puts is deprecated. Use console.log instead.', 'DEP0027'], ['util.debug is deprecated. Use console.error instead.', 'DEP0028'], ['util.error is deprecated. Use console.error instead.', 'DEP0029'] ]); -util.puts('test'); util.debug('test'); util.error('test');