Skip to content

Commit 10df21b

Browse files
committed
lib: move DEP0027 to end of life
PR-URL: #25377 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 2d578ad commit 10df21b

File tree

4 files changed

+6
-26
lines changed

4 files changed

+6
-26
lines changed

doc/api/deprecations.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,9 @@ Type: End-of-Life
590590
### DEP0027: util.puts()
591591
<!-- YAML
592592
changes:
593+
- version: REPLACEME
594+
pr-url: https://github.com/nodejs/node/pull/xxxxx
595+
description: End-of-Life.
593596
- version:
594597
- v4.8.6
595598
- v6.12.0
@@ -600,9 +603,9 @@ changes:
600603
description: Runtime deprecation.
601604
-->
602605

603-
Type: Runtime
606+
Type: End-of-Life
604607

605-
The [`util.puts()`][] API is deprecated. Please use [`console.log()`][] instead.
608+
`util.puts()` has been removed. Please use [`console.log()`][] instead.
606609

607610
<a id="DEP0028"></a>
608611
### DEP0028: util.debug()
@@ -2413,7 +2416,6 @@ Setting the TLS ServerName to an IP address is not permitted by
24132416
[`util.isSymbol()`]: util.html#util_util_issymbol_object
24142417
[`util.isUndefined()`]: util.html#util_util_isundefined_object
24152418
[`util.log()`]: util.html#util_util_log_string
2416-
[`util.puts()`]: util.html#util_util_puts_strings
24172419
[`util.types`]: util.html#util_util_types
24182420
[`util`]: util.html
24192421
[`worker.exitedAfterDisconnect`]: cluster.html#cluster_worker_exitedafterdisconnect

doc/api/util.md

-11
Original file line numberDiff line numberDiff line change
@@ -2167,16 +2167,6 @@ const util = require('util');
21672167
util.log('Timestamped message.');
21682168
```
21692169

2170-
### util.puts([...strings])
2171-
<!-- YAML
2172-
added: v0.3.0
2173-
deprecated: v0.11.3
2174-
-->
2175-
2176-
> Stability: 0 - Deprecated: Use [`console.log()`][] instead.
2177-
2178-
Deprecated predecessor of `console.log`.
2179-
21802170
[`'uncaughtException'`]: process.html#process_event_uncaughtexception
21812171
[`'warning'`]: process.html#process_event_warning
21822172
[`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`.
22072197
[`WebAssembly.Module`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module
22082198
[`assert.deepStrictEqual()`]: assert.html#assert_assert_deepstrictequal_actual_expected_message
22092199
[`console.error()`]: console.html#console_console_error_data_args
2210-
[`console.log()`]: console.html#console_console_log_data_args
22112200
[`target` and `handler`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#Terminology
22122201
[`util.format()`]: #util_util_format_format_args
22132202
[`util.inspect()`]: #util_util_inspect_object_options

lib/util.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,6 @@ function _extend(target, source) {
326326

327327
// Deprecated old stuff.
328328

329-
function puts(...args) {
330-
for (var i = 0, len = args.length; i < len; ++i) {
331-
process.stdout.write(`${args[i]}\n`);
332-
}
333-
}
334-
335329
function debug(x) {
336330
process.stderr.write(`DEBUG: ${x}\n`);
337331
}
@@ -440,8 +434,5 @@ module.exports = exports = {
440434
'DEP0028'),
441435
error: deprecate(error,
442436
'util.error is deprecated. Use console.error instead.',
443-
'DEP0029'),
444-
puts: deprecate(puts,
445-
'util.puts is deprecated. Use console.log instead.',
446-
'DEP0027')
437+
'DEP0029')
447438
};

test/parallel/test-util.js

-2
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,10 @@ assert.strictEqual(util.isFunction(), false);
145145
assert.strictEqual(util.isFunction('string'), false);
146146

147147
common.expectWarning('DeprecationWarning', [
148-
['util.puts is deprecated. Use console.log instead.', 'DEP0027'],
149148
['util.debug is deprecated. Use console.error instead.', 'DEP0028'],
150149
['util.error is deprecated. Use console.error instead.', 'DEP0029']
151150
]);
152151

153-
util.puts('test');
154152
util.debug('test');
155153
util.error('test');
156154

0 commit comments

Comments
 (0)