Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: util: document --trace-deprecation #191

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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>
  • Loading branch information
bnoordhuis committed Dec 30, 2014
commit 8b041613420f27bc26f60287386efbdf69e4b8b1
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