Mayank Agarwal has Published 373 Articles

Node.js - dnsPromises.resolve6() Method

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 13:06:06

115 Views

The dnsPromises.resolve6() method uses the DNS protocol to resolve the IPv6 addresses (AAAA records) for the hostname. The promise is resolved with an array of IPv6 addresses.Syntaxdns.resolve6(hostname, [options])Parametershostname – This parameter takes input for hostname to be resolved.options – It can have the following options −ttl – It defines the ... Read More

Node.js - dns.resolveMx() Method

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 12:57:58

515 Views

The dns.resolveMx() method uses the DNS protocol to resolve mail exchange (MX) records for the hostname. The addresses argument passed to the callback function will contain an array of objects containing both the priority and exchange objects.Syntaxdns.resolveMx(hostname, callback)Parametershostname – This parameter takes input for hostname to be resolved.callback – This ... Read More

Node.js - process.report.directory Property

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 12:51:58

154 Views

The process.report.directory property is used to get or set the directory where the report is written. The default value is the empty string that indicates the reports are written to the current working directory of the Node.js Process.Syntaxprocess.report.directoryExample 1Create a file with the name "directory.js" and copy the following code ... Read More

Node.js - dnsPromises.resolveMx() Method

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 12:43:28

263 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

Node.js - dns.resolveCname() Method

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 12:39:19

489 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

Node.js - diffieHellman.setPublicKey() Method

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 12:28:19

128 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

Node.js - dns.resolve6() Method

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 12:19:50

187 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

Node.js - diffieHellman.getPrivateKey() Method

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 12:13:49

146 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

Node.js - process.traceDeprecation() Method

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 12:02:29

3K+ 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

Node.js - dnsPromises.resolveNs() Method

Mayank Agarwal

Mayank Agarwal

Updated on 17-Jan-2022 11:58:34

183 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

Advertisements