Skip to content

Commit

Permalink
doc: util: document --trace-deprecation
Browse files Browse the repository at this point in the history
Document the --trace-deprecation flag and the `process` properties that
affect util.deprecate().

Fixes: #190
PR-URL: #191
Reviewed-By: Jonathan Ong <[email protected]>
  • Loading branch information
bnoordhuis committed Dec 30, 2014
1 parent d8586ea commit 8b04161
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions doc/api/util.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,21 @@ Marks that a method should not be used any more.
}
}, 'util.puts: Use console.log instead')

It returns a modified function which warns once by default. If
`--no-deprecation` is set then this function is a NO-OP. If
`--throw-deprecation` is set then the application will throw an exception
if the deprecated API is used.
It returns a modified function which warns once by default.

If `--no-deprecation` is set then this function is a NO-OP. Configurable
at run-time through the `process.noDeprecation` boolean (only effective
when set before a module is loaded.)

If `--trace-deprecation` is set, a warning and a stack trace are logged
to the console the first time the deprecated API is used. Configurable
at run-time through the `process.traceDeprecation` boolean.

If `--throw-deprecation` is set then the application throws an exception
when the deprecated API is used. Configurable at run-time through the
`process.throwDeprecation` boolean.

`process.throwDeprecation` takes precedence over `process.traceDeprecation`.

## util.debug(string)

Expand Down

0 comments on commit 8b04161

Please sign in to comment.