The value tested for being truthy.
All arguments besides are used as error message.
A simple assertion test that verifies whether is truthy.
If it is not, is logged.
If provided, the error is formatted using by passing along all message arguments.
The output is used as the error message.
Calling with a falsy assertion will only cause the to be printed to the console without interrupting execution of subsequent code.
When is a TTY, calling will attempt to clear the TTY.
When is not a TTY, this method does nothing.
The specific operation of can vary across operating systems and terminal types.
For most Linux operating systems, operates similarly to the shell command.
On Windows, will clear only the output in the current terminal viewport for the Node.js binary.
The display label for the counter.
Maintains an internal counter specific to and outputs to the number of times has been called with the given
Resets the internal counter specific to
The function is an alias for
If then the object's non-enumerable and symbol properties will be shown too.
Tells how many times to recurse while formatting the object.
This is useful for inspecting large complicated objects.
To make it recurse indefinitely, pass
If, then the output will be styled with ANSI color codes.
Colors are customizable; see
Uses on and prints the resulting string to
This function bypasses any custom function defined on
This method calls passing it the arguments received.
Please note that this method does not produce any XML formatting.
Prints to with newline.
Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to (the arguments are all passed to
If formatting elements are not found in the first string then is called on each argument and the resulting string values are concatenated.
See for more information.
Increases indentation of subsequent lines by two spaces.
If one or more are provided, those are printed first without the additional indentation.
An alias for
Decreases indentation of subsequent lines by two spaces.
Alternate properties for constructing the table.
Try to construct a table with the columns of the properties of (or use) and rows of and log it.
Falls back to just logging the argument if it can’t be parsed as tabular.
These can't be parsed as tabular data
Starts a timer that can be used to compute the duration of an operation.
Timers are identified by a unique
Use the same when calling to stop the timer and output the elapsed time in milliseconds to
Timer durations are accurate to the sub-millisecond.
Stops a timer that was previously started by calling and prints the result to
Prints to the string, followed by the formatted message and stack trace to the current position in the code.
Inspector only methods
The following methods are exposed by the V8 engine in the general API but do not display anything unless used in conjunction with the
This method does not display anything unless used in the inspector.
The method is the deprecated form of
The profile is then added to the Profile panel of the inspector.
Adds the profile to the Profiles panel of the inspector.
The method adds an event with the label to the Timeline panel of the inspector.
The module provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions.
Use to access this module.
Determining if crypto support is unavailable
It is possible for Node.js to be built without including support for the module.
In such cases, calling will result in an error being thrown.
SPKAC is a Certificate Signing Request mechanism originally implemented by Netscape and was specified formally as part of
Note that is deprecated since and new projects should not use this element anymore.
The module provides the class for working with SPKAC data.
The most common usage is handling output generated by the HTML5 element.
Node.js uses OpenSSL's SPKAC implementation internally.
The challenge component of the data structure, which includes a public key and a challenge.
the challenge as a UTF8 string
the public key as
if the given data structure is valid, otherwise.
As a still supported legacy interface, it is possible (but not recommended) to create new instances of the class as illustrated in the examples below.
Instances of the class can be created using the keyword or by calling as a function:
Instances of the class are used to encrypt data.
The class can be used in one of two ways:
As a stream that is both readable and writable, where plain unencrypted data is written to produce encrypted data on the readable side, or
Using the and methods to produce the encrypted data.
The or methods are used to create instances.
objects are not to be created directly using the keyword.
Example: Using objects as streams:
Using and piped streams:
Using the and methods:
Any remaining enciphered contents.
If is one of or, a string is returned.
If an is not provided, a is returned.
Once the method has been called, the object can no longer be used to encrypt data.
Attempts to call more than once will result in an error being thrown.
for method chaining.
When using an authenticated encryption mode (only and are currently supported), the method sets the value used for the additional authenticated data (AAD) input parameter.
The argument is optional for
When using, the option must be specified and its value must match the length of the plaintext in bytes.
See CCM mode
The method must be called before
the method returns a containing the authentication tag that has been computed from the given data.
The method should only be called after encryption has been completed using the method.
When using block encryption algorithms, the class will automatically add padding to the input data to the appropriate block size.
To disable the default padding call
When is, the length of the entire input data must be a multiple of the cipher's block size or will throw an error.
Disabling automatic padding is useful for non-standard padding, for instance using instead of PKCS padding.
Updates the cipher with
If the argument is given, its value must be one of or and the argument is a string using the specified encoding.
If the argument is not given, must be a or
If is a or, then is ignored.
The specifies the output format of the enciphered data, and can be or
If the is specified, a string using the specified encoding is returned.
The method can be called multiple times with new data until is called.
Calling after will result in an error being thrown.