- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 380 Articles
Mayank Agarwal
166 Views
The dnsPromises.resolveMx() method uses the DNS protocol to resolve the mail exchange records (MX Records) for the hostname. The promise is resolved with an array of objects containing both a priority and exchange property on success.SyntaxdnsPromises.resolveMx( hostname )where, hostname is the parameter that takes the input for the hostname to ... Read More
Mayank Agarwal
336 Views
The dns.resolveCname() method uses the DNS protocol to resolve CNAME records for the hostname. The addresses argument passed to the callback function will contain an array of canonical records in an array.Syntaxdns.resolveCname(hostname, callback)Parametershostname – This parameter takes the input for the hostname to be resolved.callback – This function will catch ... Read More
Mayank Agarwal
91 Views
The diffieHellman.setPublicKey() sets the Diffie-Hellman generated public key. The private key is a string if the encoding argument is provided. If no encoding is provided, the privateKey will be of type buffer, TypedArray or DataView.SyntaxdiffieHellman.setPublicKey( publicKey, [encoding] )where, encoding is the parameter that specifies the encoding of the public Key.Example ... Read More
Mayank Agarwal
130 Views
The dns.resolve6() method uses the DNS protocol to resolve the IPv6 addresses (AAAA records) for the hostname. The addresses argument that is passed to the callback will contain an array of IPv6 addresses.Syntaxdns.resolve6(hostname, [options], callback)Parametershostname – This parameter takes the input for the hostname to be resolved.options – It can ... Read More
Mayank Agarwal
103 Views
The diffieHellman.getPrivateKey() returns the Diffie-Hellman generated private key that is specified by the encoding passed. A string is returned in case if encoding is passed, else a buffer will be returned.SyntaxdiffieHellman.getPrivateKey( [encoding] )where, encoding is the parameter that specifies the encoding of the return value.Example 1Create a file with the ... Read More
Mayank Agarwal
2K+ Views
This process.traceDeprecation() method states whether the --trace-deprecation flag is set or not on the current Node.js project. This Boolean flag controls whether the trace of deprecation warning messages are printed or not.Syntaxprocess.traceDeprecation( )Example 1Create a file with the name "traceDeprecation.js" and copy the following code snippet. After creating the file, ... Read More
Mayank Agarwal
112 Views
The dnsPromises.resolveNs() method uses the DNS protocol to resolve the name server records (NS) for the hostname. On success, the promise is resolved with an array of name server records available for the hostname.SyntaxdnsPromises.resolveNs( hostname )where hostname is the parameter that takes the input for the hostname to be resolved.Example ... Read More
Mayank Agarwal
1K+ Views
The dns.reverse() method is somewhat opposite of the method dns.lookup().This method performs a reverse DNS query that resolves an IPv4 or IPv6 to an array of host names.Syntaxdns.reverse(ip, callback)Parametersip – This takes an input for ip as a string, for which the DNS needs to be found.callback – It will ... Read More
Mayank Agarwal
2K+ Views
Redis commands mostly take the input as a single string or an array of strings as arguments and the replies are sent back as a single string or an array of strings. But, while dealing with the hash values, there are a couple of exceptions.The client.hgetall() function in Node.js – ... Read More
Mayank Agarwal
10K+ Views
There are some cases where we need to exit a certain process in Node.js based upon a condition. For this condition, we have the following methods where we can escape or exit any Node.js Process.Method 1: Using the Ctrl+C keyI hope everyone knows this shortcut to exit any Node.js process ... Read More