Mayank Agarwal has Published 380 Articles

Express.js – app.enable() Method

Mayank Agarwal

Mayank Agarwal

Updated on 30-Sep-2021 12:16:52

404 Views

The app.enable() function sets the Boolean setting ‘name’ to ‘true’, where name defines one of the properties from the app settings table. Using the app.set('foo', true) for a Boolean property is same as calling the app.enable('foo') function.Syntaxapp.enable(name)Example 1Create a file with the name "appEnable.js" and copy the following code snippet. ... Read More

Express.js – app.disable() Method

Mayank Agarwal

Mayank Agarwal

Updated on 30-Sep-2021 12:13:31

557 Views

The app.disable() method disables the setting name passed in the function. This method sets the setting name to False. We can perform the same function by using the app.set() method too, by passing its value as False.Syntaxapp.disable(name)Example 1Create a file with the name "appDisable.js" and copy the following code snippet. ... Read More

Express.js – app.delete() Method

Mayank Agarwal

Mayank Agarwal

Updated on 30-Sep-2021 12:09:47

6K+ Views

The app.delete() method routes all the HTTP DELETE requests to the specified path with the specified callback functions.Syntaxapp.delete(path, callback, [callback])Parameterspath − This is the path for which the middleware function is invoked. A path can be a string, path pattern, a regular expression, or an array of all these.callback − ... Read More

Express.js – app.all() Method

Mayank Agarwal

Mayank Agarwal

Updated on 30-Sep-2021 12:01:14

3K+ Views

The app.all() method can be used for all types of routings of a HTTP request, i.e., for POST, GET, PUT, DELETE, etc., requests that are made to any specific route. It can map app types of requests with the only condition that the route should match.Syntaxapp.path(path, callback, [callback])Parameterspath − This ... Read More

Data Chunks in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:52:53

3K+ Views

Data chunks in Node.js or any other language can be defined as a fragment of data that is sent to all the servers by the client. The servers make a stream of these chunks and form a buffer stream. This buffer stream is then converted into meaningful data.Syntaxrequest.on('eventName', [callback] )ParametersThe ... Read More

Running Java in Node.js

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:51:28

2K+ Views

Node.js is an event-driven JavaScript runtime platform that is built using the Chrome’s V8 JavaScript engine. Node is mainly used for building large-scale applications. In this article, we will see how to run a Java code in Node.js.StepsCheck if Node.js is already installed on your system using the following command ... Read More

Giving Input to a Node.js Application

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:44:44

596 Views

The main aim of a Node.js application is to work as a backend technology and serve requests and return response. But we can also pass inputs directly to a Node.js application.We can use readline-sync, a third-party module to accept user inputs in a synchronous manner.Syntaxnpm install readline-syncThis will install the ... Read More

Node.js – util.debuglog() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:42:41

165 Views

The util.debuglog() method creates a function that can be used to write the desired error/debug messages to stderr. These error messages are written only upon the existence of the NODE_DEBUG environment variable.Syntaxutil.debuglog(section, [callback])ParametersThe parameters are described below −section − This parameter takes the portion of the application for which the ... Read More

Node.js – hash.update() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:28:14

424 Views

The Hash class is one of the many utility classes that is used for creating the hash digests of data. The hash.update() method updates the hash content with the data passed, and the encoding that is passed along with the parameters. If the encoding is not passed and the data ... Read More

Node.js – hash.digest() Method

Mayank Agarwal

Mayank Agarwal

Updated on 18-Aug-2021 09:26:54

1K+ Views

The Hash class is one of the many utility classes that is used for creating the hash digests of data. The hash.digest() method calculates all the data that needs to be hashed passed inside the hash function and returns them. If an encoding is defined, a string will be returned, ... Read More

Advertisements