Mayank Agarwal has Published 373 Articles

Node.js – util.debuglog() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:42:41

212 Views

The util.debuglog() method creates a function that can be used to write the desired error/debug messages to stderr. These error messages are written only upon the existence of the NODE_DEBUG environment variable.Syntaxutil.debuglog(section, [callback])ParametersThe parameters are described below −section − This parameter takes the portion of the application for which the ... Read More

Node.js – hash.update() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:28:14

563 Views

The Hash class is one of the many utility classes that is used for creating the hash digests of data. The hash.update() method updates the hash content with the data passed, and the encoding that is passed along with the parameters. If the encoding is not passed and the data ... Read More

Node.js – hash.digest() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:26:54

2K+ Views

The Hash class is one of the many utility classes that is used for creating the hash digests of data. The hash.digest() method calculates all the data that needs to be hashed passed inside the hash function and returns them. If an encoding is defined, a string will be returned, ... Read More

Node.js – v8.getHeapStatistics() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:22:25

896 Views

The v8.getHeapStatistics() method returns the statistics about a heap. The getHeapStatistics() method is a part of the v8 module that returns the details about the heap and size of the v8. The getHeapSpaceStatistics() gives stats based upon the spaces in a system, whereas the getHeapStatistics() method gives stats about the ... Read More

Setting the font color & style of the console in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:20:38

889 Views

You can use the chalk module to customize the statements printed on the console.By using it, one can change the text font-color to any color. One can also change the font-style to Bold, Italic or Underlined. Also, you can highlight the printed text.Syntaxnpm install chalkExample 1Create a file "color.js" and ... Read More

Determining the User IP Address in Node

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:18:27

502 Views

Node.js is a completely open source technology that runs on JavaScript runtime environment. When the users want to access a website or link, they connect with the link using their system IP. We can use the dns.lookup() method in Node to find the IP address of the current user.Syntaxdns.lookup(hostname, [options], ... Read More

Node.js – util.types.isUint16Array() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:05:45

85 Views

The util.types.isUint16Array() method checks whether the passed value is a builtin Uint16Array instance or not. If the above condition is satisfied, it returns True, else False.Syntaxutil.types.isUint16Array(value)ParametersIt takes a single parameter −value − This input value takes input for the required parameter and checks if it's a Uint16Array instance or not.It ... Read More

Node.js – util.types.isNativeError() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:03:01

148 Views

The util.types.isNativeError() method checks whether the passed value is a built-in error type or not. If the above condition is satisfied, it returns True, else False. The error can be of any type.Syntaxutil.types.isNativeError(value)ParametersIt takes a single parameter −value − This input value takes input for the required parameter and checks ... Read More

Node.js – util.types.isInt8Array() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 08:57:53

83 Views

The util.types.isInt8Array() method checks whether the passed value is a built-in Int8Array instance or not. If the above condition is satisfied, it returns True, else False.Syntaxutil.types.isInt8Array(value)ParametersIt takes a single parameter −value − This input value takes input for the required parameter and checks if it's an Int8Array instance or not.It ... Read More

Node.js – util.types.isAnyArrayBuffer() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 08:54:57

105 Views

The util.types.isAnyArrayBuffer() checks whether the passed value is an ArrayBuffer or a SharedArrayBuffer instance. It returns True if the above condition holds, else False.Syntaxutil.types.isAnyArrayBuffer(value)ParametersIt takes a single parameter −value − This input parameter takes input for the required datatype and checks if it's an ArrayBuffer or SharedArrayBuffer instance.It returns True ... Read More

Advertisements