Skip to content

Commit

Permalink
lib: move DEP0027 to end of life
Browse files Browse the repository at this point in the history
PR-URL: #25377
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
cjihrig committed Jan 10, 2019
1 parent 2d578ad commit 10df21b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
8 changes: 5 additions & 3 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ Type: End-of-Life
### DEP0027: util.puts()
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/xxxxx
description: End-of-Life.
- version:
- v4.8.6
- v6.12.0
Expand All @@ -600,9 +603,9 @@ changes:
description: Runtime deprecation.
-->

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.

<a id="DEP0028"></a>
### DEP0028: util.debug()
Expand Down Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -2167,16 +2167,6 @@ const util = require('util');
util.log('Timestamped message.');
```

### util.puts([...strings])
<!-- YAML
added: v0.3.0
deprecated: v0.11.3
-->

> 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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 1 addition & 10 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}
Expand Down Expand Up @@ -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')
};
2 changes: 0 additions & 2 deletions test/parallel/test-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 10df21b

Please sign in to comment.