Skip to content

Commit 2f24c2e

Browse files
committed
doc: document util.deprecate options
It seems this was missed in the PRs that added both options.
1 parent 81af7b9 commit 2f24c2e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

doc/api/util.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,21 @@ added: v14.9.0
225225
Alias for `util.debuglog`. Usage allows for readability of that doesn't imply
226226
logging when only using `util.debuglog().enabled`.
227227

228-
## `util.deprecate(fn, msg[, code])`
228+
## `util.deprecate(fn, msg[, code[, useEmitSync[, modifyPrototype]]])`
229229

230230
<!-- YAML
231231
added: v0.8.0
232232
changes:
233+
- version:
234+
- v24.5.0
235+
- v22.19.0
236+
pr-url: https://github.com/nodejs/node/pull/58928
237+
description: Add option to conditionally modify the prototype of the
238+
deprecated object.
239+
- version: v19.0.0
240+
pr-url: https://github.com/nodejs/node/pull/44711
241+
description: Add option to conditionally emit the deprecation
242+
warning synchronously.
233243
- version: v10.0.0
234244
pr-url: https://github.com/nodejs/node/pull/16393
235245
description: Deprecation warnings are only emitted once for each code.
@@ -240,6 +250,11 @@ changes:
240250
invoked.
241251
* `code` {string} A deprecation code. See the [list of deprecated APIs][] for a
242252
list of codes.
253+
* `emitSync` {boolean} When true emit the deprecation warning synchronously.
254+
**Default:** `false`.
255+
* `modifyPrototype` {boolean} When true do not change the prototype of object
256+
while emitting the deprecation warning.
257+
**Default:** `false`.
243258
* Returns: {Function} The deprecated function wrapped to emit a warning.
244259

245260
The `util.deprecate()` method wraps `fn` (which may be a function or class) in

0 commit comments

Comments
 (0)