Util
js.node.Util (extern class)
The util
module is primarily designed to support the needs of Node.js' own internal APIs.
See: https://nodejs.org/api/util.html#util_util
Static Members
Takes an async
function (or a function that returns a Promise
) and returns a function following the
error-first callback style, i.e. taking an (err, value) => ...
callback as the last argument.
See: https://nodejs.org/api/util.html#util_util_callbackify_original
debuglog(section: String): Function
The util.debuglog()
method is used to create a function that conditionally writes debug messages to stderr
based on the existence of the NODE_DEBUG
environment variable.
See: https://nodejs.org/api/util.html#util_util_debuglog_section
deprecate(fun: deprecate.T, msg: String, ?code: String): deprecate.T
The util.deprecate()
method wraps fn
(which may be a function or class) in such a way that it is marked
asdeprecated.
See: https://nodejs.org/api/util.html#util_util_deprecate_fn_msg_code
Name |
Type |
Default |
fun |
deprecate.T |
|
msg |
String |
|
code |
String |
(optional) |
The util.format()
method returns a formatted string using the first argument as a printf
-like format string
which can contain zero or more format specifiers.
See: https://nodejs.org/api/util.html#util_util_format_format_args
This function is identical to util.format()
, except in that it takes an inspectOptions
argument which
specifies options that are passed along to util.inspect()
.
See: https://nodejs.org/api/util.html#util_util_formatwithoptions_inspectoptions_format_args
Returns the string name for a numeric error code that comes from a Node.js API.
See: https://nodejs.org/api/util.html#util_util_getsystemerrorname_err
Inherit the prototype methods from one constructor
into another.
See: https://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor
The util.inspect()
method returns a string representation of object
that is intended for debugging.
See: https://nodejs.org/api/util.html#util_util_inspect_object_options
Returns true
if there is deep strict equality between val1
and val2
.
See: https://nodejs.org/api/util.html#util_util_isdeepstrictequal_val1_val2
Takes a function following the common error-first callback style, i.e. taking an (err, value) => ...
callback
as the last argument, and returns a version that returns promises.
See: https://nodejs.org/api/util.html#util_util_promisify_original
Deprecated predecessor of Console.error
.
Deprecated predecessor of console.error.
Returns true if the given "object" is an Array. false otherwise.
Returns true if the given "object" is a Bool. false otherwise.
Returns true if the given "object" is a Buffer. false otherwise.
Returns true if the given "object" is a Date. false otherwise.
Returns true if the given "object" is an Error. false otherwise.
Returns true if the given "object" is a Function. false otherwise.
Returns true if the given "object" is strictly null. false otherwise.
Returns true if the given "object" is null or undefined. false otherwise.
Returns true if the given "object" is a Float. false otherwise.
Returns true if the given "object" is strictly an Object and not a Function. false otherwise.
Returns true if the given "object" is a primitive type. false otherwise.
Returns true if the given "object" is a RegExp. false otherwise.
Returns true if the given "object" is a String. false otherwise.
Returns true if the given "object" is a Symbol. false otherwise.
Returns true if the given "object" is undefined. false otherwise.
Output with timestamp on stdout.
Deprecated predecessor of console.log.
Deprecated predecessor of console.log.
Deprecated predecessor of stream.pipe().
Name |
Parameters |
:jsRequire |
"util" |