Found 285 Articles for Node.js

Difference between JavaScript and NodeJS

Pradeep Kumar
Updated on 19-Apr-2023 17:33:08

476 Views

JavaScript is a scripting language which is used to develop HTML pages that are interactive with users. It is usually run on web browsers. NodeJS is a platform or runtime environment using which we can run JavaScript in a system rather than a browser. What is JavaScript? JavaScript is a front-end programming language used in web development. It is a lightweight object oriented scripting language that make the web page dynamic and interactive with users. HTML creates website (structure layer), CSS makes it more attractive (design layer) and JavaScript allows the users to interact with these websites rather than simply ... Read More

Importance of Node.js in JavaScript

Kalyan Mishra
Updated on 14-Apr-2023 16:24:30

134 Views

What is Node.js? Node.js is a JavaScript runtime environment which is used to execute the JavaScript code outside the browser. It can be used on different operating system like windows, Mac OS, Linux. Node.js is used to build server-side web applications which can respond fast and handle multiple connections parallelly. Why Node.js? JavaScript was created for the purpose of using it in web browsers. Node.js has enabled developers to use JavaScript for full-stack development. It allows developers to write both the client-side and server-side code in the same language and create web applications, command-line interface tools and other software. Using ... Read More

Comparison between Go & Node.js

Sabid Ansari
Updated on 07-Apr-2023 10:53:13

104 Views

When it comes to choosing the right language for a project, developers often compare different programming languages to find the best fit. In this article, we will compare two popular programming languages, Go and Node.js, to help you make an informed decision. Comparison between Go & Node.js Go and Node.js are both open-source, server-side programming languages. Go was developed by Google in 2009, while Node.js was developed by Ryan Dahl in 2009. Both languages have gained a lot of popularity in recent years, and they are often used for similar tasks, such as building web applications and APIs. ... Read More

HTTP Cookies in Node.js

Shubham Vora
Updated on 06-Apr-2023 16:07:44

8K+ Views

The cookies are the data stored in the user’s browser for quick access. For example, whenever we log in to any website, the server returns the access token, which can be stored in the browser’s cookie with the expiry time. So, whenever a user revisits the website, they don’t need to log in to the website repeatedly if the access token stored in the cookies has not expired. We can also access the browser’s cookies on the server side in NodeJS. After that, we can check if any detailed data exists in the cookies we are looking at, and if ... Read More

Node.js Alternatives

Shirjeel Yunus
Updated on 05-Apr-2023 16:45:38

204 Views

What is Node.js? Ryan Dahl developed Node.js in 2009 and its current version is v0.10.36. Node.js is a server-side platform which is developed on the JavaScript Engine of Google Chrome. This is a cross-platform runtime environment which can be used to develop server-side and networking applications. JavaScript is used to create Node.js applications which can be executed on Node.js environment installed on various platforms like OSX, Linux, and Windows. Cost of Node.js Node.js is an open-source library and can be used for free. There are many hosting platforms that utilize Node.js. Some of them provide paid services. Why Node.js Alternatives? ... Read More

Explain clearTimeout() function in Node.js

Prabhdeep Singh
Updated on 17-Mar-2023 13:37:29

291 Views

There is a timer module in node.js that is used to schedule timers and carry out specific functions at a later time. In Node.js the JavaScript function clearTimeout() is used to halt the execution of the setTimeout() function by using the timeoutID returned by a specific setTimeout() function call. This function does nothing if the timeoutID didn't match for any prior calls or if an invalid value is given. The setTimeout() JavaScript function executes the specified code after the user-specified amount of time or delay, and it returns an ID, which is a positive integer commonly referred to as the ... Read More

How to share code between Node.js and the browser?

Rushi Javiya
Updated on 07-Mar-2023 12:06:04

1K+ Views

Sharing code between the backend and front end of a full-stack application can be a challenging task. However, it's essential for building maintainable and scalable applications. By sharing code, we can avoid code duplication, reduce development time, and maintain consistency across our applications. In this tutorial, we'll explore different techniques for sharing code between Node.js and the browser and learn how to choose the best approach for our project. Techniques for Sharing Code Between Node.js and the Browser Users can follow the approaches below to share code between node.js and the browser − CommonJS Modules CommonJS modules are ... Read More

How to sorting an array without using loops in Node.js?

Shubham Vora
Updated on 06-Mar-2023 12:38:44

767 Views

In Node.js, a built-in sort() method is available to sort an array without a headache. However, as a beginner to learn how the sort() method works internally, users should learn various sorting algorithms. In this tutorial, we will learn a different algorithm to sort an array without using loops in NodeJS. Use the setInterval() method The setInterval() method allows us to invoke any particular function after each interval. Also, we can store the id of the setInterval() method in any variable and use it later to clear the interval. So, we can call a callback function in the ... Read More

How to solve “Process out of Memory Exception” in Node.js?

Shubham Vora
Updated on 28-Feb-2023 17:02:58

3K+ Views

"Process out of Memory" is an error that occurs when a Node.js program tries to use more memory than the system has available. This can happen when the program grows too big or runs for too long and can cause the system to stop working properly. To prevent this error, we may need to limit the amount of memory our program uses or find ways to optimize its performance. In this tutorial, we will learn about the "Process out of Memory Exception" in Node.js, what causes it to occur, and how to solve it. We will also explore some ... Read More

How to calculate local time in Node.js?

AmitDiwan
Updated on 16-Feb-2023 15:20:25

5K+ Views

In this article, you will understand how to calculate local time in Node.js. The Date object works with dates and times. Date objects are created with new Date(). JavaScript will use the browser's time zone and display a date as a full text string. Node.js is an open-source and cross-platform JavaScript runtime environment.As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. Example 1 In this example, we use the toDateString and toTimeString function const dateTimeObject = new Date(); console.log("A date-time object is created") console.log(`Date: ${dateTimeObject.toDateString()}`); console.log(`Time: ${dateTimeObject.toTimeString()}`); Output A date-time object is created ... Read More

Advertisements