- 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
1K+ Views
The req.cookies contains the cookies sent by the request while using the cookie-parser middleware. If the cookies are signed, please use the req.signedCookies property.Syntaxreq.cookiesInstall the cookie-parser module −npm install cookie-parserExample 1Create a file with the name "reqCookies.js" and copy the following code snippet. After creating the file, use the command ... Read More
Mayank Agarwal
1K+ Views
The res.append() method can append a specified value to the HTTP response header field. It creates new headers with the specified values, if it's not already created. The value string can take both a string input or an array.Syntaxres.append( field, [value] )Example 1Create a file with the name "resAppend.js" and ... Read More
Mayank Agarwal
201 Views
The res.app property holds a reference to the instance of an Express Application that is being used by the middleware.Syntaxres.appExample 1Create a file with the name "resApp.js" and copy the following code snippet. After creating the file, use the command "node resApp.js" to run this code as shown in the ... Read More
Mayank Agarwal
1K+ Views
The req.path property contains the path part of the requested URL. This property is widely used to track the incoming requests and their paths. It is mainly used for logging the requests.Syntaxreq.pathExample 1Create a file with the name "reqPath.js" and copy the following code snippet. After creating the file, use ... Read More
Mayank Agarwal
155 Views
The app.enabled() method checks whether a setting name property is enabled or not. It basically checks the value of a setting name and returns True if the property value is also True.Syntaxapp.enabled( name )Example 1Create a file with the name "appEnabled.js" and copy the following code snippet. After creating the ... Read More
Mayank Agarwal
53 Views
The dnsPromises.getServers() method returns an array of IP address strings, formatted across RFC 5952. These IP strings are currently configured for DNS configurations. The string will include a port only if a custom port is used.SyntaxdnsPromises.getServers( )Example 1Create a file with the name "getServers.js" and copy the following code snippet. ... Read More
Mayank Agarwal
511 Views
When a Node.js process is spawned with an IPC channel, the process.disconnect() method will close that IPC channel to the parent process, allowing the child process to exit or finish gracefully. The process will exit once there are no other connections keeping it alive.Syntaxprocess.disconnect()Example 1Create two files with the names ... Read More
Mayank Agarwal
80 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
Mayank Agarwal
313 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
Mayank Agarwal
98 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