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

callbackify(original: haxe.Function, args: haxe.extern.Rest): Function

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
Name Type
original haxe.Function
args haxe.extern.Rest
Returns
Function

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
Name Type
section String
Returns
Function

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)
Returns
deprecate.T

format(format: String, args: haxe.extern.Rest): String

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
Name Type
format String
args haxe.extern.Rest
Returns
String

formatWithOptions(inspectOptions: InspectOptions, format: String, args: haxe.extern.Rest): String

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
Name Type
inspectOptions InspectOptions
format String
args haxe.extern.Rest
Returns
String

getSystemErrorName(err: Int): String

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
Name Type
err Int
Returns
String

inherits(constructor: Class<Dynamic>, superConstructor: Class<Dynamic>): Void

Inherit the prototype methods from one constructor into another.

See: https://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor
Name Type
constructor Class<Dynamic>
superConstructor Class<Dynamic>

inspect(object: Dynamic, ?options: Null<InspectOptions>): String

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
Name Type Default
object Dynamic
options Null<InspectOptions> (optional)
Returns
String

isDeepStrictEqual(val1: Dynamic, val2: Dynamic): Bool

Returns true if there is deep strict equality between val1 and val2.

See: https://nodejs.org/api/util.html#util_util_isdeepstrictequal_val1_val2
Name Type
val1 Dynamic
val2 Dynamic
Returns
Bool

promisify(original: haxe.Function): Function

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
Name Type
original haxe.Function
Returns
Function

debug(string: String): Void

Deprecated predecessor of Console.error.

Name Type
string String

error(args: haxe.extern.Rest): Void

Deprecated predecessor of console.error.

Name Type
args haxe.extern.Rest

isArray(object: Dynamic): Bool

Returns true if the given "object" is an Array. false otherwise.

Name Type
object Dynamic
Returns
Bool

isBoolean(object: Dynamic): Bool

Returns true if the given "object" is a Bool. false otherwise.

Name Type
object Dynamic
Returns
Bool

isBuffer(object: Dynamic): Bool

Returns true if the given "object" is a Buffer. false otherwise.

Name Type
object Dynamic
Returns
Bool

isDate(object: Dynamic): Bool

Returns true if the given "object" is a Date. false otherwise.

Name Type
object Dynamic
Returns
Bool

isError(object: Dynamic): Bool

Returns true if the given "object" is an Error. false otherwise.

Name Type
object Dynamic
Returns
Bool

isFunction(object: Dynamic): Bool

Returns true if the given "object" is a Function. false otherwise.

Name Type
object Dynamic
Returns
Bool

isNull(object: Dynamic): Bool

Returns true if the given "object" is strictly null. false otherwise.

Name Type
object Dynamic
Returns
Bool

isNullOrUndefined(object: Dynamic): Bool

Returns true if the given "object" is null or undefined. false otherwise.

Name Type
object Dynamic
Returns
Bool

isNumber(object: Dynamic): Bool

Returns true if the given "object" is a Float. false otherwise.

Name Type
object Dynamic
Returns
Bool

isObject(object: Dynamic): Bool

Returns true if the given "object" is strictly an Object and not a Function. false otherwise.

Name Type
object Dynamic
Returns
Bool

isPrimitive(object: Dynamic): Bool

Returns true if the given "object" is a primitive type. false otherwise.

Name Type
object Dynamic
Returns
Bool

isRegExp(object: Dynamic): Bool

Returns true if the given "object" is a RegExp. false otherwise.

Name Type
object Dynamic
Returns
Bool

isString(object: Dynamic): Bool

Returns true if the given "object" is a String. false otherwise.

Name Type
object Dynamic
Returns
Bool

isSymbol(object: Dynamic): Bool

Returns true if the given "object" is a Symbol. false otherwise.

Name Type
object Dynamic
Returns
Bool

isUndefined(object: Dynamic): Bool

Returns true if the given "object" is undefined. false otherwise.

Name Type
object Dynamic
Returns
Bool

Output with timestamp on stdout.

Name Type
args haxe.extern.Rest

print(args: haxe.extern.Rest): Void

Deprecated predecessor of console.log.

Name Type
args haxe.extern.Rest

puts(args: haxe.extern.Rest): Void

Deprecated predecessor of console.log.

Name Type
args haxe.extern.Rest

pump(readableStream: js.node.stream.IReadable, writableStream: js.node.stream.IWritable, ?callback: Function): Void

Deprecated predecessor of stream.pipe().

Name Type Default
readableStream js.node.stream.IReadable
writableStream js.node.stream.IWritable
callback Function (optional)

Metadata

Name Parameters
:jsRequire "util"