Open In App

Node.js Utility Complete Reference

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

The Util module in node.js provides access to various utility functions. There are various utility modules available in the node.js module library. The modules are extremely useful in developing node based web applications.

The Complete list of utility are listed below:

Util

Description

Utility Module It provides access to various utility functions.
util.callbackify() It runs an asynchronous function and get a callback in the node.js.
util.debuglog() It creates a function that is based on the NODE_DEBUG environment variable.
util.format() It returns a formatted string using the first argument.
util.inherits() In this, the constructor inherits the prototype methods from one to another.
util.formatWithOptions() It returns a formatted string using the first argument.
util.inspect() It is intended for debugging and returns a string representation of the object.
util.promisify() It converts a method that returns responses using a callback function in a promise object.
util.isDeepStrictEqual() It tests the deep equality of two values.
util.deprecate() It wraps a function or class in such a way that it is marked as deprecated.
util.getSystemErrorName() It is used to know the type of error that occurs in the program.

util.types

Description

util.types.isAnyArrayBuffer() It performs type checking for any built-in ArrayBuffer objects in the node.js.
util.types.isArgumentsObject() It checks if the given value is an arguments object or not.
util.types.isArrayBuffer() It checks for built-in ArrayBuffer type objects in the node.js.
util.types.isAsyncFunction() It is used to type check for asynchronous functions in the node.js.
util.types.isBigInt64Array() It is used to type check for BigInt64Array in the node.js.
util.types.isUint16Array() It checks whether the value passed is of type Uint16Array or not.
util.types.isNativeError() It identifies whether the value is an instance of a built-in Error type.
util.types.isModuleNamespaceObject() It checks whether the following object is an instance of Module Namespace Object.
util.types.isArrayBufferView() It checks whether the value is an instance of one of the typed array objects or whether DataView.
util.types.isUint32Array() It checks whether the value passed is of type Uint32Array or not.
util.types.isFloat64Array() It is used to check for Float64Array type in the node.js.
util.types.isInt16Array() It is used to check the type for Int16Array in the node.js.
util.types.isInt8Array() It is used to type check for Int8Array in the node.js.
util.types.isDate() It is used to check the type for Date in the node.js.
util.types.isFloat32Array() It is used to type check for Float32Array in the node.js.
util.types.isProxy() It checks if the given value is a proxy instance or not.
util.types.isGeneratorObject() It checks if the given value is a generator object or not.
util.types.isBigUint64Array() It check if the given value is a BigUint64Array object.
util.types.isUint8ClampedArray() It checks if the given value is an unsigned 8-bit clamped integer array or not.
util.types.isBoxedPrimitive() It checks if the given value is a boxed primitive or not.
util.types.isGeneratorFunction() It checks if the given value is a generator function or not.
util.types.isDataView() It checks if the given value is a DataView object or not.
util.types.isSharedArrayBuffer() It checks whether the passed instance in the method is a built-in SharedArrayBuffer instance or not.
util.types.isUint8Array() It checks whether the passed instance in the method is a built-in Uint8Array instance or not.
util.types.isSet() It checks whether the passed instance in the method is a built-in Set instance or not.
util.types.isStringObject() It checks whether the passed instance in the method is a String object or not.
util.types.isSymbolObject() It determines whether the value is a symbol object.
util.types.isPromise() It determines whether the value is a built-in Promise.
util.types.isTypedArray() It determines whether the value is a built-in TypedArray instance.
util.types.isNumberObject() It checks whether the passed value is a Number object or not.
util.types.isRegExp() It checks whether the passed value is a regular expression.
util.types.isInt32Array() It checks whether the passed instance in the method is a built-in Int32Array instance or not.
util.types.isWeakSet() It determines whether the value is a built-in WeakSet instance or not.
util.types.isMap() It determines whether the value is a built-in Map instance or not.
util.types.isWeakMap() It determines whether the value is a built-in WeakMap instance or not.
util.types.isMapIterator() It determines whether the value is an iterator returned for a built-in Map instance or not.
util.types.isBooleanObject() It determines whether the value is a Boolean object or not.
util.types.isSetIterator() It determines whether the value is an iterator returned for a built-in set instance.


Last Updated : 28 Jul, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads