
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Mayank Agarwal has Published 373 Articles

Mayank Agarwal
668 Views
Node.js Redis offers certain properties which can be used as per your usecase. One such property is detect_buffers.If this property is set to True, then the replies that are sent to the callbacks are sent as buffers.This option lets you switch between the buffer and strings based upon this single ... Read More

Mayank Agarwal
2K+ Views
The chalk module is a third-party library that can be used for styling of texts. It allows the users to create their own themes in a Node.js project.This module helps the users to customize the response messages with different colors as per the preferences.It also improves the readability by providing ... Read More

Mayank Agarwal
734 Views
The 'beforeExit' event is called when Node.js empties its event loop and has no other work to schedule. The Node.js process exits normally when there is no work scheduled but a listener registered on the 'before exit' event can make async calls and thereby cause the Node.js process to continue.Example ... Read More

Mayank Agarwal
106 Views
The diffieHellman.getGenerator() method returns the Diffie-Hellman generator in the specified encoding. A string is returned in case an encoding is passed, else a buffer is returned.SyntaxdiffieHellman.getGenerator([encoding])Parametersencoding - This parameter specifies the encoding of the return value.Example 1Create a file with the name "generator.js" and copy the following code. After creating ... Read More

Mayank Agarwal
193 Views
The dnsPromises.resolveAny() method uses the DNS protocol to resolve all records (this is also known as ANY or * query). The promise is resolved with an array containing various types of records.TypeProperties'A'IPv4 address'AAAA'IPv6 address'Any'Any RecordsMXMail Exchange RecordsNAPTRName authority pointer recordsNSName server recordsPTRPointer RecordsSOAStart of Authority RecordsSRVService RecordsTXTText RecordsCNAMECanonical Name RecordsSyntaxdnsPromises.resolveAny(hostname)Parametershostname - ... Read More

Mayank Agarwal
77 Views
This method indicates about the flag value of --throw-deprecation which is set to True or False on the current Node.js project.The process.throwDeprecation() method is mutable, so the deprecation warning results in errors may be altered at runtime.Syntaxprocess.throwDeprecation( )Example 1Create a file with the name "throwDeprecation.js" and copy the following code. ... Read More

Mayank Agarwal
217 Views
The dns.resolve4() method uses the DNS protocol to resolve a IPv4 address for the hostname. The arguments passed to the callback function can contain an array of multiple addresses.Syntaxdns.resolve4(hostname, [options], callback)Parametershostname - This parameter takes input for the hostname to be resolved.options - It can have the following optionsttl - ... Read More

Mayank Agarwal
220 Views
The Immediate Timer class is used for scheduling the functions that we need to call at a certain period of time in future. These tasks can be scheduled by using the Immediate timer class and using the setImmediate() method. The Immediate class has an object for setImmediate() method and it ... Read More

Mayank Agarwal
279 Views
The diffieHellman.getPublicKey() returns the Diffie-Hellman generated public key that is specified by the encoding passed. It will return a string in case the encoding is passed, else it will return a buffer.SyntaxdiffieHellman.getPublicKey([encoding])Parametersencoding – This parameter specifies the encoding of the return value.Example 1Create a file with the name "publicKey.js" and ... Read More

Mayank Agarwal
1K+ Views
The Timeout object is internally created and is returned from the setTimeout() and setInterval() method. You can use this object and pass it to either clearTimeout() or clearInterval() methods in order to cancel the scheduled actionsFollowing are the timeout class ref objects that can be used to control the default ... Read More