Skip to content
- Tutorials
- Python Tutorial
- Taking Input in Python
- Python Operators
- Python Data Types
- Python Loops and Control Flow
- Python Functions
- Python OOPS Concept
- Python Data Structures
- Python Exception Handling
- Python File Handling
- Python Exercises
- Java
- Java Programming Language
- Java Collections
- Java 8 Tutorial
- Java Programs
- Java Interview Questions
- Java Exercises
- Java Quiz
- Java Projects
- Advance Java
- Programming Languages
- System Design
- Interview Corner
- Computer Science Subjects
- DevOps
- Linux
- Software Testing
- Databases
- Android
- Excel
- Mathematics
- Python Tutorial
- DSA
- Data Structures
- Algorithms
- Analysis of Algorithms
- Searching Algorithms
- Sorting Algorithms
- Greedy Algorithms
- Dynamic Programming
- Graph Algorithms
- Pattern Searching
- Recursion
- Backtracking
- Divide and Conquer
- Mathematical Algorithms
- Geometric Algorithms
- Bitwise Algorithms
- Randomized Algorithms
- Branch and Bound
- Algorithms Tutorial
- DSA Tutorial
- Practice
- All DSA Problems
- Problem of the Day
- Company Wise Coding Practice
- GfG SDE Sheet
- Practice Problems Difficulty Wise
- Language Wise Coding Practice
- Curated DSA Lists
- Competitive Programming
- Company Wise SDE Sheets
- DSA Cheat Sheets
- Top Interview Questions
- Puzzles
- Data Science
- Web Tech
- Courses
-
Last Updated : 12 Mar, 2019
Summarize
Comments
Improve
Node.js is an open source, a server-side script which runs on the top of Google’s open-source scripting engine V8. Node.js is fast, lightweight and efficient. It uses the asynchronous mode of operation, event-driven Input/Output rather than using the traditional threads or separate threads for each process. Node.js was originally written by Ryan Dahl in the year 2009. It is a cross-platform Javascript run-time environment that executes Javascript code outside of a browser. Node.js uses javascript for creating node applications or we can use any other language that ultimately compiles to javascript (like typescript). The javascript is written in the same way as we’d use in any client-side application. However, we need to set up the node development environment.
Node.js is the greatest tool for building real-time web applications. It provides cross-platform applications which run easily on any web. So you basically don’t need anything extra for running up a node application. You only need for making one. According to the Node.js Survey of users, 43% of Node.js programmers claim to use Node.js for enterprise apps. It’s a light, scalable and open-source language platform which makes it very easy to build apps even at the enterprise level also. Overall it increases the efficiency of the development process as it fills the gap between frontend and backend applications. It uses the approach of non-blocking I/O. In Non-blocking I/O approach, you can initiate a request in parallel for user2 without waiting for the response to the request for user1. The requests in Node.js can initiate in parallel. This non-blocking I/O eliminates the need for multi-threading.
Npm (Node Package Manager)
These are the libraries which are built by the awesome community which will solve almost all the generic problems related to the Node.js. Npm has packages which are used in our apps to make the development process faster and more efficient.Node Modules
Node.js has a set of built-in modules which can be used without any further installation. We can install some custom modules from the NPM as per the need of the application. We can also create modules of our own and use them by importing it in our apps. Basically, the Node module is a block of code which can be used again in any node.js component without impacting any other node.js component. The modules in node.js work independently without impacting the existence of any other functions.
Please Login to comment...
Similar Reads
Why are HTTP cookies used by Node.js for sending and receiving HTTP cookies?
The HTTP protocol is one of the most important protocols of the Application layer of the OSI model. The main use of this protocol is for sending hypertext information to the client to the server and server to the client to communicate on the World Wide Web. But, the HTTP protocol is a stateless protocol which means that this protocol cannot maintai
5 min read
Why Node.js doesn't see files in node_modules folder ?
Sometimes developers want to serve some static asset from node_modules. Usually, we don't want to expose any of your internal paths to the outside world. If your files are in the node_modules directory then you can make a static route in your server that fetches its files from whatever directory you specify. The express.static() function is used to
2 min read
Why to Use Node.js For Backend Development?
JavaScript is the universal language for building web applications. It is used in frontend (client-side) and backend (server-side) development as well. But the truth that the beauty of the front-end relies on the back-end can't be denied. This is when NodeJS comes into the picture. NodeJS is the best choice for server-side application development d
7 min read
Why Node.js is famous over other environments in JavaScript ?
Node.js is a platform that allows developers to build web applications with JavaScript. It is particularly useful for building real-time, high-concurrency applications, such as chat systems, online games, and real-time data processing pipelines. Let me explain to you node.js in a more fun and simpler way: Think of Node.js as a magical microphone at
5 min read
What is LTS releases of Node.js why should you care ?
Node.js is a powerful and popular open-source runtime environment for JavaScript that allows developers to build scalable, high-performance web applications. One of the key features of Node.js is its ability to receive updates and new versions regularly, which can bring new features, improvements, and bug fixes to the platform. However, not all upd
3 min read
Why Node.js is a Single Threaded Language ?
Node.js is a popular runtime environment that allows developers to build scalable network applications using JavaScript. One of the most distinctive features of Node.js is its single-threaded architecture, which often raises questions among new developers about why it was designed this way. This article will delve into the rationale behind Node.js
4 min read
Why we use setTimeout() function in Node.js ?
The purpose of setTimeout function is to execute a piece of code after a certain interval of time. The setTimeout() function accepts two arguments. The first argument is a function and the second argument is time in milliseconds. The setTimeout() executes the function passed in the first argument after the time specified in the second argument. Jav
3 min read
Why do we need C++ Addons in Node.js ?
C++ Addons in Node.js extend its capabilities by allowing native C++ code integration. They improve the performance for intense tasks, providing access to C/C++ libraries, and facilitating low-level system interactions that are not easily to achieve with JavaScript alone. C++ addons in Node.js allow developers to write performance-critical parts of
4 min read
Why Zlib is used in Node.js ?
Zlib is a crucial library in Node.js used for data compression and decompression. It's widely employed in web development and various applications to handle data more efficiently. Understanding Zlib's significance in Node.js can greatly enhance your capability to manage data transmission, storage, and overall application performance. What is Zlib?Z
4 min read
Why does Vite create multiple TypeScript config files: tsconfig.json, tsconfig.app.json and tsconfig.node.json?
In Vite TypeScript projects you may have noticed three typescript configuration files, tsconfig.json, tsconfig.app.json, and tsconfig.node.json. Each file is used for a different purpose and understanding their use cases can help you manage TypeScript configurations for your project. In this article, you will learn about the three TypeScript config
6 min read
Node.js Automatic restart Node.js server with nodemon
We generally type following command for starting NodeJs server: node server.js In this case, if we make any changes to the project then we will have to restart the server by killing it using CTRL+C and then typing the same command again. node server.js It is a very hectic task for the development process. Nodemon is a package for handling this rest
1 min read
Top 3 Best Packages Of Node.js that you should try being a Node.js Developer
Node.js is an open-source and server-side platform built on Google Chrome's JavaScript Engine (V8 Engine). Node.js has its own package manager called NPM( Node Package Manager) which has very useful and incredible libraries and frameworks that makes our life easier as a developer to work with Node.js. The 3 Best Packages of Node.js that you should
4 min read
Node.js Connect Mysql with Node app
Node.js is a powerful platform for building server-side applications, and MySQL is a widely used relational database. Connecting these two can enable developers to build robust, data-driven applications. In this article, we'll explore how to connect a Node.js application with a MySQL database, covering the necessary setup, configuration, and basic
2 min read
How to resolve 'node' is not recognized as an internal or external command error after installing Node.js ?
Encountering the error message ‘node’ is not recognized as an internal or external command after installing Node.js can be frustrating, especially when you’re eager to start working on your project. This error usually means that your system cannot find the Node.js executable because the path to it is not set correctly in your system's environment v
2 min read
Javascript Program For Swapping Kth Node From Beginning With Kth Node From End In A Linked List
Given a singly linked list, swap kth node from beginning with kth node from end. Swapping of data is not allowed, only pointers should be changed. This requirement may be logical in many situations where the linked list data part is huge (For example student details line Name, RollNo, Address, ..etc). The pointers are always fixed (4 bytes for most
5 min read
Javascript Program For Inserting A Node After The N-th Node From The End
Insert a node x after the nth node from the end in the given singly linked list. It is guaranteed that the list contains the nth node from the end. Also 1 <= n. Examples: Input : list: 1->3->4->5 n = 4, x = 2 Output : 1->2->3->4->5 4th node from the end is 1 and insertion has been done after this node. Input : list: 10->8
5 min read
Why is [1,2] + [3,4] = “1,23,4” in JavaScript ?
We have given an expression [1, 2] + [3, 4], and the result of this expression is "1,23,4". In this article, we will know why this weird result we get. Example : => [1,2] + [3,4] => "1,23,4" => [1, 2, 3, 4] + [9, 8] => "1, 2, 3, 49, 8" => [4] + [] => "4" => [] + [] => "" Before knowing the reason first we understand the addi
2 min read
Why API’s are consumed in HTML 5 ?
What is an API?API stands for (Application Programming Interfaces) and is a way to build applications using off-the-shelf components, not just web development and scripting languages. Description of APIsIt is the building block exposed by a programming language to make it easier for developers to create complex functionality. It abstracts away more
3 min read
Why does div display:table-row ignore margin ?
If you have HTML div elements next to each other with display: table-cell; and you want to set a margin between them then there will be no effect of margin. Therefore, we have to add margin externally. In this article, we will learn how to add margin in the table cell. Example: In this example, we will use the margin property. C/C++ Code <!DOCTY
2 min read
Why we should use ASP.NET?
ASP.NET is a web framework designed by Microsoft Inc. that is extensively used to build robust web applications. In this article, we will analyze why ASP.NET should be chosen over other accessible web frameworks. Following are some main advantages of ASP.NET which makes it better than other frameworks available in the market: The ASP.NET framework
2 min read
Why You Should Choose React Native?
The smartphone app market is ever changing, new apps come every day, and some old ones disappear from our memories, and our phones as well. In this tumultuous ecosystem, developers struggle to keep making apps that will please users, because with each new horizon we conquer, their expectations rise. And so to out-do their previous efforts, develope
4 min read
What is the best way to include CSS file? Why use @import?
CSS property can be include in the HTML page in a number of different ways. HTML documents are formatted according to the information in the style sheet which is to be included.There are many ways to include CSS file which are listed below: External style sheet (Using HTML <link> Tag): External CSS contains separate CSS file which contains on
4 min read
Why “0” is equal to false in JavaScript ?
In JavaScript "0" is equal to false because "0" is of type string but when it tested for equality the automatic type conversion of JavaScript comes into effect and converts the "0" to its numeric value which is 0 and as we know 0 represents false value. So, "0" equals to false. Example: This example illustrates why "0" equals to false. <script
2 min read
Why to use SASS instead of CSS ?
SASS (Syntactically Awesome Style Sheet) is a CSS preprocessor. It is a scripting language that is compiled into regular CSS, allowing you to use features such as variables, nested rules, and mixins in your stylesheets. It adds additional features and functionality to CSS. SASS can help to make your CSS more organized and easier to maintain, as wel
6 min read
Why “0” is not equal to false in if condition in JavaScript ?
The reason behind this behavior is that JavaScript treats non-empty string as true. First, "0" is converted into its boolean value, by automatic type conversion which is true. Therefore, if statement executes. Example: This example illustrates why "0" is not equal to false in if() condition. C/C++ Code // JavaScript script to demonstrate // why “0”
1 min read
Why Linux Hosting is Cheaper than Windows Hosting ?
Most of the data that we get across the web, via websites, email services, etc. are essentially stored or hosted on servers. These servers run on various platforms (operating systems). The two major operating systems are Unix-based Linux and Microsoft Windows. Apart from these, Ubuntu and Debian OS are also used, though less. About 2/3 rd of all se
5 min read
Why doesn't JavaScript support multithreading?
What is Multithreading? Multithreading is a sort of execution model that enables different threads to exist inside the setting of a process with the end goal that they execute autonomously yet share their process resources. A thread keeps up a rundown of data important to its execution including the priority schedule, exception handlers, a set of C
2 min read
Why error "$ is not defined" occurred in jQuery ?
One of the most common errors faced by jQuery developers is the '$ is not defined' error. At first, it may seem like a small error, but considering the fact that more than 70 percent of the website uses jQuery in some form or other, this may turn out to create a huge mess. Reason behind this error: This error basically arises, when the developer is
2 min read
Why require_once() function is so bad to use in PHP ?
The require_once() function is an inbuilt function in PHP which is useful in case if we want to include a PHP file in another one i.e. when we need to include a file more than once in PHP script. It is used to check if the file is included more than once or not as it ignores all the inclusions while running the script if the file is already include
3 min read
Why to put “_” in front of filename in SCSS ?
When we add "_" in front of the SCSS file, it means that it is partial for SCSS. When the compiler gets any SCSS files starting with "_", it simply ignores the file. If you want this partial for SCSS to be included for styles, you must use @import. The advantage of using partials is that you can use style files to organize your code and all the fil
2 min read
Article Tags :
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id, check: true }), success:function(result) { jQuery.ajax({ url: writeApiUrl + 'suggestions/auth/' + `${post_id}/`, type: "GET", dataType: 'json', xhrFields: { withCredentials: true }, success: function (result) { $('.spinner-loading-overlay:eq(0)').remove(); var commentArray = result; if(commentArray === null || commentArray.length === 0) { // when no reason is availaible then user will redirected directly make the improvment. // call to api create-improvement-post $('body').append('
'); $('.spinner-loading-overlay').show(); jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id, }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.unlocked-status--improve-modal-content').css("display","none"); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); return; } var improvement_reason_html = ""; for(var comment of commentArray) { // loop creating improvement reason list markup var comment_id = comment['id']; var comment_text = comment['suggestion']; improvement_reason_html += `
${comment_text}
`; } $('.improvement-reasons_wrapper').html(improvement_reason_html); $('.improvement-bottom-btn').html("Create Improvement"); $('.improve-modal--improvement').hide(); $('.improvement-reason-modal').show(); }, error: function(e){ $('.spinner-loading-overlay:eq(0)').remove(); // stop loader when ajax failed; }, }); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); } else { if(loginData && !loginData.isLoggedIn) { $('.improve-modal--overlay').hide(); if ($('.header-main__wrapper').find('.header-main__signup.login-modal-btn').length) { $('.header-main__wrapper').find('.header-main__signup.login-modal-btn').click(); } return; } } }); $('.left-arrow-icon_wrapper').on('click',function(){ if($('.improve-modal--suggestion').is(":visible")) $('.improve-modal--suggestion').hide(); else{ $('.improvement-reason-modal').hide(); } $('.improve-modal--improvement').show(); }); function loadScript(src, callback) { var script = document.createElement('script'); script.src = src; script.onload = callback; document.head.appendChild(script); } function suggestionCall() { var suggest_val = $.trim($("#suggestion-section-textarea").val()); var array_String= suggest_val.split(" ") var gCaptchaToken = $("#g-recaptcha-response-suggestion-form").val(); var error_msg = false; if(suggest_val != "" && array_String.length >=4){ if(suggest_val.length <= 2000){ var payload = { "gfg_post_id" : `${post_id}`, "suggestion" : `
${suggest_val}
`, } if(!loginData || !loginData.isLoggedIn) // User is not logged in payload["g-recaptcha-token"] = gCaptchaToken jQuery.ajax({ type:'post', url: "https://apiwrite.geeksforgeeks.org/suggestions/auth/create/", xhrFields: { withCredentials: true }, crossDomain: true, contentType:'application/json', data: JSON.stringify(payload), success:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-section-textarea').val(""); jQuery('.suggest-bottom-btn').css("display","none"); // Update the modal content const modalSection = document.querySelector('.suggestion-modal-section'); modalSection.innerHTML = `
Thank You!
Your suggestions are valuable to us.
You can now also contribute to the GeeksforGeeks community by creating improvement and help your fellow geeks.
`; }, error:function(data) { jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Something went wrong."); jQuery('#suggestion-modal-alert').show(); error_msg = true; } }); } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Minimum 5 Words and Maximum Character limit is 2000."); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } } else{ jQuery('.spinner-loading-overlay:eq(0)').remove(); jQuery('#suggestion-modal-alert').html("Enter atleast four words !"); jQuery('#suggestion-modal-alert').show(); jQuery('#suggestion-section-textarea').focus(); error_msg = true; } if(error_msg){ setTimeout(() => { jQuery('#suggestion-section-textarea').focus(); jQuery('#suggestion-modal-alert').hide(); }, 3000); } } document.querySelector('.suggest-bottom-btn').addEventListener('click', function(){ jQuery('body').append('
'); jQuery('.spinner-loading-overlay').show(); if(loginData && loginData.isLoggedIn) { suggestionCall(); return; } // load the captcha script and set the token loadScript('https://www.google.com/recaptcha/api.js?render=6LdMFNUZAAAAAIuRtzg0piOT-qXCbDF-iQiUi9KY',[], function() { setGoogleRecaptcha(); }); }); $('.improvement-bottom-btn.create-improvement-btn').click(function() { //create improvement button is clicked $('body').append('
'); $('.spinner-loading-overlay').show(); // send this option via create-improvement-post api jQuery.ajax({ url: writeApiUrl + 'create-improvement-post/?v=1', type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json', xhrFields: { withCredentials: true }, data: JSON.stringify({ gfg_id: post_id }), success:function(result) { $('.spinner-loading-overlay:eq(0)').remove(); $('.improve-modal--overlay').hide(); $('.improvement-reason-modal').hide(); $('.create-improvement-redirection-to-write').attr('href',writeUrl + 'improve-post/' + `${result.id}` + '/', '_blank'); $('.create-improvement-redirection-to-write')[0].click(); }, error:function(e) { $('.spinner-loading-overlay:eq(0)').remove(); var result = e.responseJSON; if(result.detail.non_field_errors.length){ $('.improve-modal--improve-content .improve-modal--improve-content-modified').text(`${result.detail.non_field_errors}.`); jQuery('.improve-modal--overlay').show(); jQuery('.improve-modal--improvement').show(); $('.locked-status--impove-modal').css("display","block"); $('.unlocked-status--improve-modal-content').css("display","none"); $('.improve-modal--improvement').attr("status","locked"); $('.improvement-reason-modal').hide(); } }, }); });
Continue without supporting 😢