- 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](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
46 Views
The dns.lookupService() method resolves the given address and port into a hostname and service. This method uses the operating system’s underlying getnameinfo implementation.A TypeError will be thrown if the address is not a valid IP address. The difference between the dnsPromises and dns module is that dnsPromises provides an alternative ... Read More
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
585 Views
An ‘exit’ event is emitted when the process is going to exit due to the following reasons −Process.exit() method is called explicitly.The node event loop no longer have any task to perform.SyntaxEvent: 'exit'Example 1Create a file "exit.js" and copy the following code snippet. After creating the file, use the command ... Read More
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
63 Views
The process.report.filename property is used to get or set the filename where the report will be written. If this value is set as an empty string, the output filename will be made as per the timestamp, PID and sequence number. Its default value is an empty string.Syntaxprocess.report.filenameExample 1Create a file ... Read More
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
103 Views
The dns.getServers() method returns an array of IP address strings. The address will be formatted as per the RFC 5952 standard, that are configured for DNS resolution. The string will also include the port section if a custom port is used.Syntaxdns.getServers()ParametersSince it returns the list of the servers, it does ... Read More
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
71 Views
diffieHellman.getPrime() returns the Diffie-Hellman generated prime with the specified encoding. It returns a string in case the encoding is passed, else a buffer will be returned.SyntaxdiffieHellman.getPrime([encoding])ParametersIt takes only one parameterencoding – This parameter specifies the encoding of the return value.Example 1Create a file with the name "prime.js" and copy the ... Read More
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
98 Views
The dnsPromises.resolveTxt() method uses the DNS protocol to resolve the text search (TXT records) for the hostname. The promise is resolved with a twodimensional array of the text records available for the hostname on success.SyntaxdnsPromises.resolveTxt(hostname)ParametersIt takes only one parameterhostname – This parameter takes input for the hostname to be resolved.Example ... Read More
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
66 Views
The dnsPromises.lookup() method resolves the hostname (e.g., tutorialspoint.com) into the first found A IPv4) or AAAA (IPv6) record. The properties available under the options are optional.dns.lookup() does not have anything to do with the DNS protocol. The implementation uses an OS facility that can associate names with addresses and vice ... Read More
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
172 Views
The process.emitWarning() method can be used to emit custom or user-defined process warnings. This can be listened by adding a handler to the warning event.Syntaxprocess.emitWarning(warning, [options])Parameterswarning – This is the warning that will be emitted.options –type – This is the type of warning being emitted. Default ‘Warning’code – This is ... Read More
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
282 Views
The dns.resolveTxt() method uses the DNS protocol to resolve the text queries (TXT Records) for the hostname. The addresses argument passed to the callback function is a two-dimensional array that contains the array of text records available for the hostname.Syntaxdns.resolveTxt(hostname, callback)Parametershostname – This parameter takes input for hostname to be ... Read More
![Mayank Agarwal](https://www.tutorialspoint.com/assets/profiles/333719/profile/60_290052-1619507248.jpg)
Mayank Agarwal
151 Views
process.report is an object whose methods generate the diagnostic reports for the current process. It is found under the process module.Syntaxprocess.reportExample 1Create a file with the name "report.js" and copy the following code snippet. After creating the file, use the command "node report.js" to run this code.// process.report Demo Example ... Read More