Skip to content

Commit 8b04161

Browse files
committed
doc: util: document --trace-deprecation
Document the --trace-deprecation flag and the `process` properties that affect util.deprecate(). Fixes: #190 PR-URL: #191 Reviewed-By: Jonathan Ong <me@jongleberry.com>
1 parent d8586ea commit 8b04161

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

doc/api/util.markdown

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,21 @@ Marks that a method should not be used any more.
267267
}
268268
}, 'util.puts: Use console.log instead')
269269

270-
It returns a modified function which warns once by default. If
271-
`--no-deprecation` is set then this function is a NO-OP. If
272-
`--throw-deprecation` is set then the application will throw an exception
273-
if the deprecated API is used.
270+
It returns a modified function which warns once by default.
271+
272+
If `--no-deprecation` is set then this function is a NO-OP. Configurable
273+
at run-time through the `process.noDeprecation` boolean (only effective
274+
when set before a module is loaded.)
275+
276+
If `--trace-deprecation` is set, a warning and a stack trace are logged
277+
to the console the first time the deprecated API is used. Configurable
278+
at run-time through the `process.traceDeprecation` boolean.
279+
280+
If `--throw-deprecation` is set then the application throws an exception
281+
when the deprecated API is used. Configurable at run-time through the
282+
`process.throwDeprecation` boolean.
283+
284+
`process.throwDeprecation` takes precedence over `process.traceDeprecation`.
274285

275286
## util.debug(string)
276287

0 commit comments

Comments
 (0)