<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Node &#8211; The Web Developer Guide</title>
	<atom:link href="https://thewebdeveloperguide.com/category/backend/node/feed/" rel="self" type="application/rss+xml" />
	<link>https://thewebdeveloperguide.com</link>
	<description>A Developers Guide to Web Develoment</description>
	<lastBuildDate>Fri, 31 Mar 2023 14:48:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2</generator>
	<item>
		<title>What is Express.js? A Comprehensive Guide to All You Need to Know</title>
		<link>https://thewebdeveloperguide.com/what-is-expressjs/</link>
		
		<dc:creator><![CDATA[Kris Barton]]></dc:creator>
		<pubDate>Fri, 31 Mar 2023 14:42:07 +0000</pubDate>
				<category><![CDATA[Backend]]></category>
		<category><![CDATA[Express]]></category>
		<category><![CDATA[Node]]></category>
		<guid isPermaLink="false">https://thewebdeveloperguide.com/?p=345</guid>

					<description><![CDATA[What is Express.js? What can it be used to build? What are the advantages of using it? Great questions - I've got answers!]]></description>
										<content:encoded><![CDATA[
<p>What is Express.js? Express.js is a backend web framework for <a href="https://thewebdeveloperguide.com/what-is-nodejs/">Node.js</a> that provides a great selection of features for building web applications, RESTful APIs, and other server-side applications quickly and easily.</p>



<p>The <a href="https://expressjs.com/" target="_blank" rel="noopener">Express.js website</a> describes the framework as a:</p>



<p>“Fast, unopinionated, minimalist web framework for Node.js”</p>



<p>Sounds great, right? Let’s catch the <strong>Express</strong> train and find out a little more!<br><br>(That’s an awful joke and I’m not even sorry).</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="800" height="500" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/what-is-express.js.png" alt="what is express.js? All you need to know about express.js!" class="wp-image-417" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/what-is-express.js.png 800w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/what-is-express.js-300x188.png 300w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/what-is-express.js-768x480.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure></div>


<h2 class="wp-block-heading">How does Express.js work?</h2>



<p>Express JS works by providing a set of methods that developers use to create web applications and APIs using <a href="https://thewebdeveloperguide.com/what-is-nodejs/">node.js</a>.</p>



<p>An Express.js application is typically set up by:</p>



<h3 class="wp-block-heading">Install</h3>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="540" height="210" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/npm-logo.png" alt="what is express.js? Using NPM to install express.js" class="wp-image-384" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/npm-logo.png 540w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/npm-logo-300x117.png 300w" sizes="(max-width: 540px) 100vw, 540px" /></figure>



<p>Install Express.js using Node Package Manager. This is done via the command line using:</p>



<p>&nbsp;$ npm install express&nbsp;&nbsp;</p>



<p>…more on this later.&nbsp;</p>



<p>Users can use the <strong><em>express</em></strong> command to create a project with a basic Express.js application structure, which is also a really cool feature.</p>



<h3 class="wp-block-heading">Define Routes</h3>



<p>Next, developers typically define the routes for the application using Express.js router, which maps incoming requests and connects with the define handler function.</p>



<p><a href="https://expressjs.com/en/starter/basic-routing.html" target="_blank" rel="noopener">The Express.js website</a> defines it in a little more detail:</p>



<p>“Routing refers to determining how an application responds to a client request to a particular endpoint, which is a URI (or path) and a specific HTTP request method (GET, POST, and so on).”</p>



<h3 class="wp-block-heading">Middleware</h3>



<p>Developers can also write custom middleware functions that handle various aspects of the request/response cycle including logging, authentication, and error handling.</p>



<p>According to the official guide on the Express.js website, Middleware can perform the following tasks:</p>



<ul>
<li>Execute any code.</li>



<li>Make changes to the request and the response objects.</li>



<li>End the request-response cycle.</li>



<li>Call the next middleware in the stack.</li>
</ul>



<h3 class="wp-block-heading">Handle Requests</h3>



<p>Developers write handler functions that deal with incoming requests, perform any necessary logic, then send the appropriate response back to the client.</p>



<section class="subscribe stFlx">
        
        <section class="subscribe__content">
            <span class="subscribe__heading">Debug Your Dev Time!</span>
            <p>Take your career to the next level and sign up to our mailing list. I'll send you all the dev info you'll ever need: tips, tricks, tutorials, and much more.</p>
            <form method="post" class="stFlx stFlx--centre hero__form" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
                <div style="display: none;">
                    <input type="hidden" name="meta_web_form_id" value="718770369" />
                    <input type="hidden" name="meta_split_id" value="" />
                    <input type="hidden" name="listname" value="awlist5282620" />
                    <input type="hidden" name="redirect" value="https://www.thewebdeveloperguide.com/almost-done" id="redirect_d84f8b0f01936c977b27970141bc3b5f" />
        
                    <input type="hidden" name="meta_adtracking" value="webdeveloperguide_shortcode" />
                    <input type="hidden" name="meta_message" value="1" />
                    <input type="hidden" name="meta_required" value="email" />
                    <input type="hidden" name="meta_tooltip" value="" />
                </div>
                <input id="awf_field-101138743" type="text" name="email" placeholder="Your email address..." value="" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
                <input name="submit" type="submit"  class="btn" value="Send me all the dev info I'll ever need..."  />
                <div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=rBxMHAwMrByc" alt="" /></div>
            </form>
            <p class="hero__nospam">Don't worry, we won't spam you. We hate that too. We'll just send you useful information you can use and/or learn from. Pinky promise.</p>
        </section>
     </section>



<h3 class="wp-block-heading">Use Middleware</h3>



<p>Developers can use built-in or third-party middleware functions to add functionality to their applications, such as serving static files, parsing request bodies, and handline cookies.</p>



<h3 class="wp-block-heading">Start the Server</h3>



<p>Developers start the Express.js server using the <em>listen </em>method, which brings the server to a specific port and begins listening for incoming requests.</p>



<h3 class="wp-block-heading">In a nutshell</h3>



<p>In a nutshell, the functionality for an Express.js application follows this lifecycle:</p>



<ol>
<li>The client makes a request to the Express.js application</li>



<li>The router matches the request to the appropriate route handler function</li>



<li>For some applications, this may now involve middleware functions to handle various aspects of the request/response cycle</li>



<li>The handler then returns a response back to the client</li>
</ol>



<h3 class="wp-block-heading">What is the request/response cycle?</h3>



<p>Since I’ve mentioned it a few times, I should probably explain what the request/response cycle actually is.</p>



<p>The request/response cycle refers to the sequence of steps that occur when a client (like a web browser) sends a request to a server, and the server responds by sending back, yeah, you guessed it…a response.</p>



<p>Typically, it runs like this:</p>



<ol>
<li>The client sends a request to the server. This request specifies the URL of the resource it wants to use, along with any relevant data (such as HTTP headers or request parameters)</li>



<li>The server takes the request and then processes it</li>



<li>A response is then generated by the server, in the form of data (whether it be HTML, JSON or something else), and sends it back to the client</li>



<li>The client takes the data and processes it</li>
</ol>



<div class="recommendation" data-ad="GB"><span class="recommendation__top-pick">Our top pick</span><div class="recommendation__content"><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="stHeading recommendation__content__title" data-ad-click="Learn Express.js @ CodeAcademy heading" target="_blank" rel="noopener">Learn Express.js @ CodeAcademy</a><p class="recommendation__content__description">Check out easy-to-follow, interactive Express.js courses @ CodeAcademy (some are FREE)</p><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="btn btn--secondary recommendation__content__button" data-ad-click="Learn Express.js @ CodeAcademy button" target="_blank" rel="noopener">Sign Up Now</a><p class="recommendation__content__notice">If you click this link and make a purchase, we earn a commission at no additional cost to you.</p></div><div class="recommendation__image"><a href="https://www.pntrac.com/t/8-12462-301286-213588" data-ad-click="Learn Express.js @ CodeAcademy image" target="_blank" rel="noopener"><img loading="lazy" src="/wp-content/uploads/2023/03/code-academy.jpeg" width="300" height="300" alt="Learn Express.js @ CodeAcademy" /></a></div></div>



<h2 class="wp-block-heading">What Is Express.js Used For?</h2>



<p>So now we know what Express.js is and how it works, let’s take a look at what it&#8217;s actually used for.</p>



<h3 class="wp-block-heading">Single Page Applications</h3>



<p>Express.js can be used to create fantastic Single Page Applications (or SPAs for short).</p>



<h4 class="wp-block-heading">What are SPAs?</h4>



<p>SPAs are web applications that load all the necessary resources (such as HTML, CSS, and JavaScript) on the first request to the server and then dynamically update the content based on user interaction, without requiring a user to reload the page.</p>



<p>Express.js can be used to set up the routing for these SPAs so that the interactivity can happen all on the same page.</p>



<h3 class="wp-block-heading">Real-Time Collaboration Tools</h3>



<p>Express.js can be used to create several different types of real-time collaboration tools such as:</p>



<ul>
<li>A chat application.</li>



<li>A collaborative document editor.</li>



<li>A whiteboard application for sharing top-level ideas.</li>



<li>A video-conferencing application.</li>
</ul>



<p>Express.js is great for this kind of application because it makes integrating WebSocket into the framework easy.</p>



<h3 class="wp-block-heading">Streaming Applications</h3>



<p>Streaming applications deal with a lot of data. Often it’s layered. Pretty complex stuff. To handle it effectively, you need a strong framework that makes it easy to handle asynchronous data.</p>



<p>Express.js is your framework for this and you can build multiple different types of streaming applications too.</p>



<p>Such as:</p>



<ul>
<li>Live streaming: real-time streaming is great because of the previously mentioned ease in which WebSockets can be integrated into the Express JS framework.</li>



<li>Video on demand: Express JS can be used to build video-on-demand streaming applications that allow users to stream pre-recorded video content. Easy integration of HLS or MPEG-DASH modules allows Express JS applications to deliver video content into manageable chunks.</li>



<li>Audio streaming: Using WebSockets, Express JS can be used to deliver audio streaming content to users.</li>
</ul>



<h3 class="wp-block-heading">Fintech Applications</h3>



<p>Express .js can also be used to create Fintech Applications…</p>



<p>…hang on. What are Fintech Applications?</p>



<p>Great question &#8211; here’s our answer.</p>



<h4 class="wp-block-heading">What are Fintech Applications?</h4>



<p>Fintech Applications are applications, programs, or platforms that handle financial services. These are designed to make financial transactions easy to do, efficient, and cost-effective.</p>



<p>Examples of such are applications like:</p>



<ul>
<li>Mobile payment apps like Paypal.</li>



<li>Digital wallets like Google Wallet or Apple pay.</li>



<li>Personal finance apps like Mint.</li>
</ul>



<p>…and many more.</p>



<h4 class="wp-block-heading">Express.js Fintech Applications</h4>



<p>With Express.js you can build the following kinds of Fintech Applications:</p>



<ul>
<li><strong>Payment processing</strong>. Express.js can be used to build a solid payment processing application that can utilise powerful 3rd party APIs such as Stripe, Paypal, or Klarna.</li>



<li><strong>Trading platform. </strong>Express.js can also be used to build trading platforms to buy or sell cryptocurrencies, utilising the Coinbase or Alpha Vantage APIs.</li>



<li><strong>Personal Finance management. </strong>Express.js can be used to make an application to track personal finances, set financial goals, and manage investments. To do this, Express JS can utilising such APIs as Plaid or Yodlee to securely connect to users’ bank accounts and retrieve transaction data.</li>



<li><strong>Crowdfunding platform. </strong>With Express.js, an application can be built using Paypal or Stripe APIs to serve as a great crowdfunding platform.</li>
</ul>



<section class="subscribe stFlx">
        
        <section class="subscribe__content">
            <span class="subscribe__heading">Debug Your Dev Time!</span>
            <p>Take your career to the next level and sign up to our mailing list. I'll send you all the dev info you'll ever need: tips, tricks, tutorials, and much more.</p>
            <form method="post" class="stFlx stFlx--centre hero__form" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
                <div style="display: none;">
                    <input type="hidden" name="meta_web_form_id" value="718770369" />
                    <input type="hidden" name="meta_split_id" value="" />
                    <input type="hidden" name="listname" value="awlist5282620" />
                    <input type="hidden" name="redirect" value="https://www.thewebdeveloperguide.com/almost-done" id="redirect_d84f8b0f01936c977b27970141bc3b5f" />
        
                    <input type="hidden" name="meta_adtracking" value="webdeveloperguide_shortcode" />
                    <input type="hidden" name="meta_message" value="1" />
                    <input type="hidden" name="meta_required" value="email" />
                    <input type="hidden" name="meta_tooltip" value="" />
                </div>
                <input id="awf_field-101138743" type="text" name="email" placeholder="Your email address..." value="" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
                <input name="submit" type="submit"  class="btn" value="Send me all the dev info I'll ever need..."  />
                <div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=rBxMHAwMrByc" alt="" /></div>
            </form>
            <p class="hero__nospam">Don't worry, we won't spam you. We hate that too. We'll just send you useful information you can use and/or learn from. Pinky promise.</p>
        </section>
     </section>



<h2 class="wp-block-heading">Why You Should Use Express.js</h2>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="800" height="500" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/express.-js-features.png" alt="what is express.js? express.js features" class="wp-image-425" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/express.-js-features.png 800w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/express.-js-features-300x188.png 300w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/express.-js-features-768x480.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure>



<p>You should use Express.js for many reasons.</p>



<h3 class="wp-block-heading">Easy to Learn</h3>



<p>Express JS is a simple framework that’s easy to pick up for developers already familiar with JavaScript.</p>



<h3 class="wp-block-heading">Flexible and Speedy</h3>



<p>Because Express.js is an unopinionated framework, it’s flexible to allow you to integrate any number of additional modules to suit the needs of your application with ease and no fuss.</p>



<p>As well as being unopinionated, it’s a minimal framework. This means there’s no clutter and it’s extra speedy.</p>



<h3 class="wp-block-heading">Part of the MEAN and MERN Stacks</h3>



<p>With <a href="https://thewebdeveloperguide.com/what-is-nodejs/" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-nodejs/">Node.js</a> at the foundation, many tech stacks are combined to create a full-stack system. These are often combined to create cool names.</p>



<p>MEAN and MERN tech stacks are probably the most popular, with the E in each stack representing Express JS, the N in each stack representing <a href="https://thewebdeveloperguide.com/what-is-nodejs/" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-nodejs/">Node.js</a>, and the M in each stack representing MongoDB.</p>



<p>The A and R letters stand for Angular and React respectively.</p>



<h3 class="wp-block-heading">Easy Integration</h3>



<p>As touched upon elsewhere in this article, another reason why you should use Express.js is the fact that you can easily integrate other modules during application creation. Anything from MongoDB to Paypal is fair game.</p>



<h3 class="wp-block-heading">Scalability</h3>



<p>Express.js applications are highly scalable and this is proven by the number of big companies using the technology.</p>



<p>With Express.js being flexible, lightweight, and built on top of <a href="https://thewebdeveloperguide.com/what-is-nodejs/" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-nodejs/">Node.js</a>, Express inherits many of the scalability features that comes with Node.</p>



<h3 class="wp-block-heading">Community Support</h3>



<p>Express.js has a large community that regularly contributes to the project, developing features, bug fixing, providing support in the forums, writing documentation, and adding tutorials.</p>



<h3 class="wp-block-heading">Powerful Routing System</h3>



<p>Express.js has a robust and flexible routing system that allows developers to define routes that correspond to specific URLs and HTTP methods.&nbsp;</p>



<p>This makes it easier to handle different types of requests and route them to the correct functions or handlers.</p>



<p>In addition, Express.js routing allows for:</p>



<ul>
<li><strong>Support for multiple HTTP methods.</strong> Express allows developers to define roots for GET, POST, PUT, and DELETE HTTP methods and therefore making it easier to respond with the appropriate data.</li>



<li><strong>Parameterisation.</strong> Express also allows developers to define routes with parameters, such as /users/:id. This makes it easy to handle dynamic URLs and deal with data from the request.</li>



<li><strong>Middleware.</strong> Express allows developers to attach middleware functions to routes, which can perform tasks such as authorisation, logging, or error handling. This makes it easy to add common functionality to multiple routes &#8211; AKA a more single source of truth. This will make the code easy to maintain going forward.</li>



<li><strong>Route groups.</strong> Express allows developers to group related routes, which makes it easier to apply middleware and other settings to multiple routes at once.</li>



<li><strong>Route nesting.</strong> Express allows developers to nest routes inside other routes, which makes it easier to make complex routing structures.</li>
</ul>



<div class="recommendation" data-ad="GB"><span class="recommendation__top-pick">Our top pick</span><div class="recommendation__content"><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="stHeading recommendation__content__title" data-ad-click="Learn Express.js @ CodeAcademy heading" target="_blank" rel="noopener">Learn Express.js @ CodeAcademy</a><p class="recommendation__content__description">Check out easy-to-follow, interactive Express.js courses @ CodeAcademy (some are FREE)</p><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="btn btn--secondary recommendation__content__button" data-ad-click="Learn Express.js @ CodeAcademy button" target="_blank" rel="noopener">Signup Now</a><p class="recommendation__content__notice">If you click this link and make a purchase, we earn a commission at no additional cost to you.</p></div><div class="recommendation__image"><a href="https://www.pntrac.com/t/8-12462-301286-213588" data-ad-click="Learn Express.js @ CodeAcademy image" target="_blank" rel="noopener"><img loading="lazy" src="/wp-content/uploads/2023/03/code-academy.jpeg" width="300" height="300" alt="Learn Express.js @ CodeAcademy" /></a></div></div>



<h2 class="wp-block-heading">Limitation of Using Express.js</h2>



<p>So now that we’ve covered all of the positives of using Express.js, let’s take a look at some of the negatives.</p>



<h3 class="wp-block-heading">Potentially Steep Learning Curve</h3>



<p>Express.js is a simple and unopinionated framework, which means it doesn’t have tons of functionality out-of-the-box and also means to build a full application a developer is going to need to use several modules.</p>



<p>As the application grows and gets more complex, more modules will be required.</p>



<p>This might be quite daunting for a new developer and they might find it difficult to learn, especially if they’re unfamiliar with <a href="https://thewebdeveloperguide.com/what-is-nodejs/" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-nodejs/">Node.js</a> and how the runtime works.</p>



<p>Even if a developer is familiar with Express and Node, if they come to a project late and it’s already complex with a lot of 3rd party functionality, it could still be difficult to pick it all up.&nbsp;</p>



<h3 class="wp-block-heading">Lack of Built-In Functionality</h3>



<p>One of the things that makes it great, could be a disadvantage for someone looking for a solution that has everything they need out of the box.</p>



<p>As I previously mentioned, Express.js is simple and unopinionated &#8211; designed for developers to add modules to build additional functionality.</p>



<p>If someone isn’t looking for that, then this is a disadvantage for them choosing the Express framework.</p>



<h3 class="wp-block-heading">Security</h3>



<p>Because of the nature of 3rd party modules, you’re relying on multiple developers to keep their code up-to-date with the latest security patches.</p>



<p>This is particularly a concern if a module or your application deals with potentially sensitive user data.</p>



<section class="subscribe stFlx">
        
        <section class="subscribe__content">
            <span class="subscribe__heading">Debug Your Dev Time!</span>
            <p>Take your career to the next level and sign up to our mailing list. I'll send you all the dev info you'll ever need: tips, tricks, tutorials, and much more.</p>
            <form method="post" class="stFlx stFlx--centre hero__form" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
                <div style="display: none;">
                    <input type="hidden" name="meta_web_form_id" value="718770369" />
                    <input type="hidden" name="meta_split_id" value="" />
                    <input type="hidden" name="listname" value="awlist5282620" />
                    <input type="hidden" name="redirect" value="https://www.thewebdeveloperguide.com/almost-done" id="redirect_d84f8b0f01936c977b27970141bc3b5f" />
        
                    <input type="hidden" name="meta_adtracking" value="webdeveloperguide_shortcode" />
                    <input type="hidden" name="meta_message" value="1" />
                    <input type="hidden" name="meta_required" value="email" />
                    <input type="hidden" name="meta_tooltip" value="" />
                </div>
                <input id="awf_field-101138743" type="text" name="email" placeholder="Your email address..." value="" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
                <input name="submit" type="submit"  class="btn" value="Send me all the dev info I'll ever need..."  />
                <div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=rBxMHAwMrByc" alt="" /></div>
            </form>
            <p class="hero__nospam">Don't worry, we won't spam you. We hate that too. We'll just send you useful information you can use and/or learn from. Pinky promise.</p>
        </section>
     </section>



<h2 class="wp-block-heading">How To Create an Express.js App</h2>



<p>Now comes the exciting bit: getting started with Express JS code!</p>



<h3 class="wp-block-heading">Installing Express.js</h3>



<p>First, let’s install Express.</p>



<h4 class="wp-block-heading">Get Your Directory</h4>



<p>In your command line of choice (Visual Studio Code terminal will do us just fine), get to where you want to install the code.&nbsp;</p>



<p>If you’re using Visual Studio Code, just click the Terminal option in the main menu, then click New Terminal.&nbsp;</p>



<p>This will open your command line terminal in the location of your current project.</p>



<p>If you need to go to a subfolder from here, you can use the CD (change directory) command to reach where you need to be.</p>



<p>For example, if you&#8217;re in your main project folder and want to install express in your app subfolder, you could just do:</p>



<pre class="wp-block-code"><code>Cd app/</code></pre>



<p>For me, I wanted to go to my tutorials folder and then my express folder, so I did:</p>



<pre class="wp-block-code"><code>Cd tutorials/</code></pre>



<p>And then:</p>



<pre class="wp-block-code"><code>Cd express/</code></pre>



<h4 class="wp-block-heading">Install Command</h4>



<p>Now we’re in the right directory, let’s run the install command:</p>



<pre class="wp-block-code"><code>$ npm install express</code></pre>



<p>Here we’re using Node Package Manager to grab the modules from the online Node directory and then install them.</p>



<h3 class="wp-block-heading">Hello World Example</h3>



<p>Now we have Express installed, let’s set up a super simple Hello World app.&nbsp;</p>



<h4 class="wp-block-heading">Create Your JS File</h4>



<p>In the directory where you installed Express, create a JS folder. Call it app.js./</p>



<p>Then copy and paste the following into your app JS file:</p>



<div class="wp-block-group is-layout-constrained"><div class="wp-block-group__inner-container">
<pre class="wp-block-code"><code>const express = require('express')<be />const app = express() <br /> const port = 3000 <br /><br /> app.get('/', (req, res) =&gt; { <br /> &nbsp;&nbsp;res.send('Hello World!') <br /> }) <br /><br /> app.listen(port, () =&gt; { <br /> &nbsp;&nbsp;console.log(`Example app listening on port ${port}`)<br /> })</code></pre>



<p>Next, in your terminal run:</p>



<pre class="wp-block-code"><code>node app.js</code></pre>



<p>This will run the app locally on the port we’ve specified. So, in the example above port 3000.</p>



<p>Essentially, we have a local server running on port 3000 and we can test it’s working by typing <a href="http://localhost:3000" target="_blank" rel="noopener">http://localhost:3000</a> in your web browser.</p>



<h4 class="wp-block-heading">Let’s Add a New Page</h4>



<p>So, in the above example, we have Express listening for ‘/’ AKA the localhost:3000 index page. But what if we wanted to add a new page? What would we do then?</p>



<p>Let’s take a look &#8211; we’ll add an about page! In your code, add the following:</p>



<pre class="wp-block-code"><code>app.get('/about', (req, res) =&gt; { <br> &nbsp;&nbsp;&nbsp;&nbsp;res.send('About page innit') <br> })</code></pre>



<p>Run your app again with:</p>



<pre class="wp-block-code"><code>node app.js</code></pre>



<p>Now, in your web browser go to <a href="https://localhost:3000/about" target="_blank" rel="noopener">https://localhost:3000/about</a> and you will see the content of your about page.</p>



<h2 class="wp-block-heading">So…what is Express.js?</h2>



<p>Let’s sum up everything we’ve covered here.</p>



<p>What is Express.js? Express.js is:</p>



<ul>
<li>Is a fast, straightforward, minimal, and unopinionated framework for <a href="https://thewebdeveloperguide.com/what-is-nodejs/" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-nodejs/">Node.js.</a></li>



<li>Express JS provides developers with a set of methods that will help create web applications and APIs.</li>



<li>Express JS can be used to create SPAs, Real-time Collaboration Tools, Streaming Applications, and Fintech Applications.</li>



<li>The advantages of Express.js are that it’s easy to learn if you’re used to <a href="https://thewebdeveloperguide.com/what-is-nodejs/" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-nodejs/">Node.js</a> and the way it works, it’s flexible and speedy, it’s part of the MEAN and MERN tech stacks so widely adopted, it’s easy to integrate, it’s easy to scale an Express JS app, great community support, and it comes with a powerful routing system right out of the box.</li>



<li>The disadvantages of Express.js is that it can be hard to learn if you’re not used to the <a href="https://thewebdeveloperguide.com/what-is-nodejs/" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-nodejs/">Node.js</a> tech stack and how it works, or if you come to a complex application late into the project, lack of built-in functionality, and potential security issues.</li>



<li>Installing and creating a simple routing takes minutes to set up.</li>
</ul>



<div class="recommendation" data-ad="GB"><span class="recommendation__top-pick">Our top pick</span><div class="recommendation__content"><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="stHeading recommendation__content__title" data-ad-click="Learn Express.js @ CodeAcademy heading" target="_blank" rel="noopener">Learn Express.js @ CodeAcademy</a><p class="recommendation__content__description">Check out easy-to-follow, interactive Express.js courses @ CodeAcademy (some are FREE)</p><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="btn btn--secondary recommendation__content__button" data-ad-click="Learn Express.js @ CodeAcademy button" target="_blank" rel="noopener">Sign Up Now</a><p class="recommendation__content__notice">If you click this link and make a purchase, we earn a commission at no additional cost to you.</p></div><div class="recommendation__image"><a href="https://www.pntrac.com/t/8-12462-301286-213588" data-ad-click="Learn Express.js @ CodeAcademy image" target="_blank" rel="noopener"><img loading="lazy" src="/wp-content/uploads/2023/03/code-academy.jpeg" width="300" height="300" alt="Learn Express.js @ CodeAcademy" /></a></div></div>



<h2 class="wp-block-heading">Further Reading</h2>



<ul>
<li><a href="https://kinsta.com/knowledgebase/what-is-express-js/" target="_blank" rel="noopener">What is Express JS by Kinsta</a></li>



<li><a href="https://en.wikipedia.org/wiki/Express.js" target="_blank" rel="noopener">Express JS Wikipedia</a></li>



<li><a href="https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs" target="_blank" rel="noopener">Express JS Mozilla</a></li>



<li><a href="https://www.simplilearn.com/tutorials/nodejs-tutorial/what-is-express-js" target="_blank" rel="noopener">Express JS Simple Learn</a></li>
</ul>



<section class="subscribe stFlx">
        
        <section class="subscribe__content">
            <span class="subscribe__heading">Debug Your Dev Time!</span>
            <p>Take your career to the next level and sign up to our mailing list. I'll send you all the dev info you'll ever need: tips, tricks, tutorials, and much more.</p>
            <form method="post" class="stFlx stFlx--centre hero__form" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
                <div style="display: none;">
                    <input type="hidden" name="meta_web_form_id" value="718770369" />
                    <input type="hidden" name="meta_split_id" value="" />
                    <input type="hidden" name="listname" value="awlist5282620" />
                    <input type="hidden" name="redirect" value="https://www.thewebdeveloperguide.com/almost-done" id="redirect_d84f8b0f01936c977b27970141bc3b5f" />
        
                    <input type="hidden" name="meta_adtracking" value="webdeveloperguide_shortcode" />
                    <input type="hidden" name="meta_message" value="1" />
                    <input type="hidden" name="meta_required" value="email" />
                    <input type="hidden" name="meta_tooltip" value="" />
                </div>
                <input id="awf_field-101138743" type="text" name="email" placeholder="Your email address..." value="" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
                <input name="submit" type="submit"  class="btn" value="Send me all the dev info I'll ever need..."  />
                <div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=rBxMHAwMrByc" alt="" /></div>
            </form>
            <p class="hero__nospam">Don't worry, we won't spam you. We hate that too. We'll just send you useful information you can use and/or learn from. Pinky promise.</p>
        </section>
     </section>
</div></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>What is Node.js? A Comprehensive Guide to All You Need to Know</title>
		<link>https://thewebdeveloperguide.com/what-is-nodejs/</link>
		
		<dc:creator><![CDATA[Kris Barton]]></dc:creator>
		<pubDate>Thu, 23 Mar 2023 12:05:37 +0000</pubDate>
				<category><![CDATA[Backend]]></category>
		<category><![CDATA[Node]]></category>
		<guid isPermaLink="false">https://thewebdeveloperguide.com/?p=291</guid>

					<description><![CDATA[What is Node.js used for? What can you build with it? How's it built? Where did it come from?

Let's dive a little deeper.]]></description>
										<content:encoded><![CDATA[
<div class="article-snippet">
<p>Node.js is a server-side JavaScript runtime that can be used to create backend and frontend web applications such as web applications, chat applications, APIs or streaming applications.</p>



<p>Yeah, you read that right &#8211; <strong><em>a  server-side JavaScript runtime.</em></strong></p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex">
<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="450" height="268" data-id="248"  src="https://thewebdeveloperguide.com/wp-content/uploads/2023/02/mind-blown.jpg" alt="" class="wp-image-248" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/02/mind-blown.jpg 450w, https://thewebdeveloperguide.com/wp-content/uploads/2023/02/mind-blown-300x179.jpg 300w" sizes="(max-width: 450px) 100vw, 450px" /></figure>
</figure>



<p>The <a href="https://nodejs.org/en/about/" data-type="URL" data-id="https://nodejs.org/en/about/" target="_blank" rel="noreferrer noopener">Node.js website</a> sums it up further with:</p>



<blockquote class="wp-block-quote">
<p>As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.</p>
<cite><a href="https://nodejs.org/en/about/" target="_blank" data-type="URL" data-id="https://nodejs.org/en/about/" rel="noreferrer noopener">Nodejs.org</a></cite></blockquote>
</div>



<p>Pretty cool stuff, right? But what is Node.js used for? What can you build with it? How&#8217;s it built? Where did it come from?</p>



<p>Well, let&#8217;s dive a little deeper.</p>



<p>First, we&#8217;ll take a look at the history of Node.js.</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="800" height="500" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/What-is...-1.png" alt="what is node.js? By the web developer guide" class="wp-image-369" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/What-is...-1.png 800w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/What-is...-1-300x188.png 300w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/What-is...-1-768x480.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure>



<h2 class="wp-block-heading">The History of Node.js</h2>



<p>Node.js was created by software developer Ryan Dahl in 2009.</p>



<p>But Node.js wasn&#8217;t the first JavaScript server-side runtime. </p>



<p>Far from it. </p>



<p>15 years from it.</p>



<p>So what even <em>was</em> the first server-side JavaScript runtime then? Let&#8217;s take a look&#8230;</p>



<div class="recommendation" data-ad="GB"><span class="recommendation__top-pick">Our top pick</span><div class="recommendation__content"><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="stHeading recommendation__content__title" data-ad-click="Learn Node.js @ CodeAcademy heading" target="_blank" rel="noopener">Learn Node.js @ CodeAcademy</a><p class="recommendation__content__description">Check out easy-to-follow, interactive Node.js courses @ CodeAcademy (some are FREE)</p><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="btn btn--secondary recommendation__content__button" data-ad-click="Learn Node.js @ CodeAcademy button" target="_blank" rel="noopener">Sign Up Now</a><p class="recommendation__content__notice">If you click this link and make a purchase, we earn a commission at no additional cost to you.</p></div><div class="recommendation__image"><a href="https://www.pntrac.com/t/8-12462-301286-213588" data-ad-click="Learn Node.js @ CodeAcademy image" target="_blank" rel="noopener"><img loading="lazy" src="/wp-content/uploads/2023/03/code-academy.jpeg" width="300" height="300" alt="Learn Node.js @ CodeAcademy" /></a></div></div>



<h3 class="wp-block-heading">The First Server-Side JavaScript runtime</h3>



<p>In 1996 Netscape released Livewire Pro Web, a technology that aimed to take on Microsoft&#8217;s ASP server-side offering as a part of the since dubbed Browser Wars.</p>



<p>However, Microsoft&#8217;s ASP did allow for a kind of JavaScript (it was called JScript, Microsoft&#8217;s early implementation of  JS) as one of three core languages &#8211; the others being PerlScript and VBScript.</p>



<p>But this wasn&#8217;t good enough for Netscape &#8211; they went all in on JavaScript. </p>



<p>We know this isn&#8217;t a thing anymore (neither is Netscape for that matter), so what happened?</p>



<h4 class="wp-block-heading">What happened to Netscape LiveWire Pro Web?</h4>



<p>Since you&#8217;ve probably never heard of Netscape LiveWire Pro Web before, you can probably take a good guess at who won those browser wars, right?</p>



<p>Microsoft.</p>



<p>Yeah, Microsoft won a browser war. If you can believe such a thing.</p>



<p>The context for the above highly sarcastic comment: web developers who have ever had to support Microsoft Internet Explorer will look back at them with the contempt they deserve. </p>



<p>Here&#8217;s a Rick and Morty meme to demonstrate it.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" loading="lazy" width="600" height="631" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/rick-and-morty-memes-what-is-your-purpose.jpg" alt="what is node.js? Rick and morty Internet Explorer meme" class="wp-image-305" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/rick-and-morty-memes-what-is-your-purpose.jpg 600w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/rick-and-morty-memes-what-is-your-purpose-285x300.jpg 285w" sizes="(max-width: 600px) 100vw, 600px" /></figure></div>


<h4 class="wp-block-heading">Why did Netscape LiveWire Pro Web fail?</h4>



<p>It failed for 3 reasons:</p>



<ul>
<li>It was a pain in one&#8217;s anus to use (<a href="https://philip.greenspun.com/wtr/livewire.html" data-type="URL" data-id="https://philip.greenspun.com/wtr/livewire.html" target="_blank" rel="noreferrer noopener">as detailed in this developer review</a>).</li>



<li>JavaScript was a relatively young language at the time and nobody knew whether it&#8217;d be well adopted.</li>



<li>Soon after it&#8217;s launch, LiveWire Pro Web was already lagging behind its competitor because </li>



<li>Netscape just didn&#8217;t invest in it. </li>
</ul>



<p>Okay, obscure technology tangent over &#8211; let&#8217;s get back to answering the what is Node.js question.</p>



<p>Let&#8217;s pick the history of Node.js back up in 2009, with Ryan Dahl&#8230;</p>



<h3 class="wp-block-heading">Early Node.js Development</h3>



<p>Ryan Dahl created Node.js in 2009 after criticising the offerings of Apache HTTP Servers and their limited possibilities of handling requests.</p>



<p>Dahl wanted to create a lightweight and efficient server-side technology that could competently handle large-scale and real-time applications.</p>



<p>Before Node.js came onto the scene, developers primarily used backend languages such as PHP, Ruby, or Java for server-side programming, but these languages came with flaws. Dahl recognised they weren&#8217;t always efficient at handling large-scale applications with heavy data traffic. </p>



<p>Dahl saw this as an opportunity to create something new, something <em>better</em>. So, he created a server-side technology that leveraged the speed and versatility of JavaScript, a language that was already widely used on the client side.</p>



<p>Node.js was built to leverage Google&#8217;s powerful V8 JavaScript engine that&#8217;s quick than <em>dog shit off a chrome shovel</em>. Sorry. That analogy is something my dad used to say. I have no idea about the real-world implications of dog shit and chrome shovel speeds, but let&#8217;s just say it&#8217;s <em>fast</em>. <em>Very, very fast</em>. </p>



<p>&#8230;but what is the V8 JavaScript Engine? Let&#8217;s take a look&#8230;</p>



<h4 class="wp-block-heading">What is Google&#8217;s V8 JavaScript Engine?</h4>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="500" height="500" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/google-v8-js-engine-logo.png" alt="what is node.js? Gogole's V8 JavaScript Engine logo" class="wp-image-376" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/google-v8-js-engine-logo.png 500w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/google-v8-js-engine-logo-300x300.png 300w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/google-v8-js-engine-logo-150x150.png 150w" sizes="(max-width: 500px) 100vw, 500px" /></figure>



<div class="article-snippet">
<p>Google&#8217;s V8 JavaScript Engine  is an open-source JavaScript engine developed by Google for use in Google&#8217;s Chrome web browser and a number of other projects &#8211; most notably Node.js.</p>



<p>It provides a high-performance execution environment for JavaScript code, compiling JavaScript into machine code for fast execution. </p>



<p>The V8 engine is known for its speed, low memory footprint, and efficient garbage collection. </p>



<p>Additionally, it implements the latest version of the ECMAScript (JavaScript) language specification, providing a modern and feature-rich runtime environment for web developers.</p>
</div>



<p>Now let&#8217;s get back into the history of Node.js&#8230;</p>



<h3 class="wp-block-heading">A New Approach to Server-Side Programming</h3>



<p>It would be impossible for me to properly answer the what is node.js? question without mentioning the new approach to server-side programming it introduced.</p>



<p>That new approach?<em><strong> Event-driven, non-blocking I/O.</strong></em></p>



<p>Okay. A bit of a mouthful and there are a few concepts to get our heads around here, but this essentially means Node.js is able to handle large volumes of data traffic and real-time applications. This makes it a popular choice for any developer building chat apps, gaming platforms, and streaming services.</p>



<p><a href="#how-does-nodejs-work" data-type="internal" data-id="#how-does-nodejs-work">If you&#8217;re interested, we go into more detail about exactly what Event-driven, non-blocking I/O actually means right here.</a></p>



<h3 class="wp-block-heading">Node.js Popularity</h3>



<p>Since Node.js was initially released on 27th May 2009, it&#8217;s been gaining popularity and momentum and has quickly become a major player in web development.</p>



<p>Today, Node.js is used by companies such as Netflix, LinkedIn, Walmart, and Uber, among many others, to build fast, scalable, and reliable web applications. </p>



<p>Even better, Node.js also has a large and active community of developers who continue to contribute to its growth and development.</p>



<h3 class="wp-block-heading">Node.js Milestones</h3>



<p>So let&#8217;s pick back up the history of Node.js for a second and discuss some of the milestones that have made the runtime so popular.</p>



<ul>
<li>As we know, Node.js was released on 27th May 2009.</li>



<li>In November 2009, Dahl demonstrated the project at the European JSConf. At the time, Node.js comprised Google&#8217;s V8 JavaScript engine, an event loop and a low-level I/O API (more on these later).</li>



<li>In January 2010, a package manager was introduced in the form of NPM &#8211; Node Package Manager.</li>



<li>In June 2011, a native version of Node.js was implemented for Windows, having previously been available in Linux and Mac OS X.</li>



<li>Node.js continues to flourish&#8230;</li>
</ul>



<section class="subscribe stFlx">
        
        <section class="subscribe__content">
            <span class="subscribe__heading">Debug Your Dev Time!</span>
            <p>Take your career to the next level and sign up to our mailing list. I'll send you all the dev info you'll ever need: tips, tricks, tutorials, and much more.</p>
            <form method="post" class="stFlx stFlx--centre hero__form" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
                <div style="display: none;">
                    <input type="hidden" name="meta_web_form_id" value="718770369" />
                    <input type="hidden" name="meta_split_id" value="" />
                    <input type="hidden" name="listname" value="awlist5282620" />
                    <input type="hidden" name="redirect" value="https://www.thewebdeveloperguide.com/almost-done" id="redirect_d84f8b0f01936c977b27970141bc3b5f" />
        
                    <input type="hidden" name="meta_adtracking" value="webdeveloperguide_shortcode" />
                    <input type="hidden" name="meta_message" value="1" />
                    <input type="hidden" name="meta_required" value="email" />
                    <input type="hidden" name="meta_tooltip" value="" />
                </div>
                <input id="awf_field-101138743" type="text" name="email" placeholder="Your email address..." value="" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
                <input name="submit" type="submit"  class="btn" value="Send me all the dev info I'll ever need..."  />
                <div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=rBxMHAwMrByc" alt="" /></div>
            </form>
            <p class="hero__nospam">Don't worry, we won't spam you. We hate that too. We'll just send you useful information you can use and/or learn from. Pinky promise.</p>
        </section>
     </section>



<h2 class="wp-block-heading">How Does Node.js Work?</h2>



<p>Node.js provides a set of libraries and tools that allow developers to write server-side applications using JavaScript syntax.</p>



<p>As previously mentioned, one of the key features of Node.js is its event-driven architecture, which allows for the efficient handling of large numbers of concurrent connections.</p>



<p>This is made up of 2 main elements:</p>



<ul>
<li>The Event Loop</li>



<li>Asynchronous I/O Operations</li>
</ul>



<p>Let&#8217;s take a look at just what in the hell those mean.</p>



<div class="recommendation" data-ad="GB"><span class="recommendation__top-pick">Our top pick</span><div class="recommendation__content"><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="stHeading recommendation__content__title" data-ad-click="Learn Node.js @ CodeAcademy heading" target="_blank" rel="noopener">Learn Node.js @ CodeAcademy</a><p class="recommendation__content__description">Check out easy-to-follow, interactive Node.js courses @ CodeAcademy (some are FREE)</p><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="btn btn--secondary recommendation__content__button" data-ad-click="Learn Node.js @ CodeAcademy button" target="_blank" rel="noopener">Sign Up Now</a><p class="recommendation__content__notice">If you click this link and make a purchase, we earn a commission at no additional cost to you.</p></div><div class="recommendation__image"><a href="https://www.pntrac.com/t/8-12462-301286-213588" data-ad-click="Learn Node.js @ CodeAcademy image" target="_blank" rel="noopener"><img loading="lazy" src="/wp-content/uploads/2023/03/code-academy.jpeg" width="300" height="300" alt="Learn Node.js @ CodeAcademy" /></a></div></div>



<h3 class="wp-block-heading">Event Loop</h3>



<p>Node.js provides an event loop that continuously checks for new events and executes the event handlers in turn. This allows developers to write non-blocking code that can handle a huge number of simultaneous requests without using tonnes of system resources.</p>



<h3 class="wp-block-heading">Asynchronous I/O Operations</h3>



<p>Another important aspect of Node.js under the hood is its use for <strong><em>Asynchronous I/O Operations</em></strong>.</p>



<p>Asynchronous I/O Operations essentially mean that Node.js can perform tasks such as reading and writing files or making network requests without blocking the main event loop.</p>



<p>Instead, Node.js uses callbacks or promises to handle the results of these operations once they are complete.</p>



<p>As I&#8217;ve mentioned before: <em>Node.js is like dogshit off a chrome shovel</em> <em>&#8211; FAST</em>.</p>



<p>These are just two of the main features of Node.js &#8211; let&#8217;s take at the others.</p>


<section class="subscribe stFlx">
        
        <section class="subscribe__content">
            <span class="subscribe__heading">Debug Your Dev Time!</span>
            <p>Take your career to the next level and sign up to our mailing list. I'll send you all the dev info you'll ever need: tips, tricks, tutorials, and much more.</p>
            <form method="post" class="stFlx stFlx--centre hero__form" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
                <div style="display: none;">
                    <input type="hidden" name="meta_web_form_id" value="718770369" />
                    <input type="hidden" name="meta_split_id" value="" />
                    <input type="hidden" name="listname" value="awlist5282620" />
                    <input type="hidden" name="redirect" value="https://www.thewebdeveloperguide.com/almost-done" id="redirect_d84f8b0f01936c977b27970141bc3b5f" />
        
                    <input type="hidden" name="meta_adtracking" value="webdeveloperguide_shortcode" />
                    <input type="hidden" name="meta_message" value="1" />
                    <input type="hidden" name="meta_required" value="email" />
                    <input type="hidden" name="meta_tooltip" value="" />
                </div>
                <input id="awf_field-101138743" type="text" name="email" placeholder="Your email address..." value="" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
                <input name="submit" type="submit"  class="btn" value="Send me all the dev info I'll ever need..."  />
                <div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=rBxMHAwMrByc" alt="" /></div>
            </form>
            <p class="hero__nospam">Don't worry, we won't spam you. We hate that too. We'll just send you useful information you can use and/or learn from. Pinky promise.</p>
        </section>
     </section>



<h2 class="wp-block-heading">Features of Node.js</h2>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="800" height="500" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Node-js-Features.png" alt="what is node.js? what are the features of node.js?" class="wp-image-381" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Node-js-Features.png 800w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Node-js-Features-300x188.png 300w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Node-js-Features-768x480.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure>



<p>So we know what Node.js is and why it was created, but why is it so good?</p>



<p>One good way of answering the &#8216;what is Node.js&#8217; question is to take a deep dive into it&#8217;s many great features. </p>



<p>Let&#8217;s take a look:</p>



<ul>
<li>Asynchronous, non-blocking I/O.</li>



<li>Event-driven architecture.</li>



<li>Cross-platform compatibility.</li>



<li>Built-in modules.</li>



<li>NPM ecosystem.</li>



<li>Scalability.</li>
</ul>



<p>We&#8217;ve already covered why Asynchronous, non-blocking I/O and Event-driven architecture is so good, so let&#8217;s jump ahead to some of the features we haven&#8217;t really covered yet.</p>



<h3 class="wp-block-heading">Cross-platform compatibility</h3>



<p>Node.js is great because it&#8217;s compatible with a wide range of operating systems, making it way easier to develop and deploy applications across different platforms.</p>



<p>As a developer it&#8217;s also great: it doesn&#8217;t matter what kind of system you choose (or your company chooses for you), Node.js will work on it. </p>



<p>This makes it a really flexible server-side solution.  </p>



<div class="recommendation" data-ad="GB"><span class="recommendation__top-pick">Our top pick</span><div class="recommendation__content"><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="stHeading recommendation__content__title" data-ad-click="Learn Node.js @ CodeAcademy heading" target="_blank" rel="noopener">Learn Node.js @ CodeAcademy</a><p class="recommendation__content__description">Check out easy-to-follow, interactive Node.js courses @ CodeAcademy (some are FREE)</p><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="btn btn--secondary recommendation__content__button" data-ad-click="Learn Node.js @ CodeAcademy button" target="_blank" rel="noopener">Sign Up Now</a><p class="recommendation__content__notice">If you click this link and make a purchase, we earn a commission at no additional cost to you.</p></div><div class="recommendation__image"><a href="https://www.pntrac.com/t/8-12462-301286-213588" data-ad-click="Learn Node.js @ CodeAcademy image" target="_blank" rel="noopener"><img loading="lazy" src="/wp-content/uploads/2023/03/code-academy.jpeg" width="300" height="300" alt="Learn Node.js @ CodeAcademy" /></a></div></div>



<h3 class="wp-block-heading">Built-in Modules</h3>



<p>Node.js has a number of built-in modules out of the box that provides developers with a great range of tools to hit the ground running building web applications.</p>



<p>These tools include:</p>



<ul>
<li><strong>HTTP:</strong> An easy-to-use API for creating servers and making HTTP requests.</li>



<li><strong>HTTPS:</strong> Same as above, but for, well, HTTPS requests.</li>



<li><strong>File System:</strong> a module for reading and writing files, creating and deleting directories and much more.</li>



<li><strong>Path:</strong> A set of utilities for working with file paths. Sounds simple, but <em>really</em> useful in practice in my experience.</li>



<li><strong>Events:</strong> A simple yet powerful event emitter pattern that can be used to emit and listen to events in an application.</li>



<li><strong>Stream:</strong> A powerful set of APIs for working with streams of data, including reading and writing data from and to files and network connections.</li>



<li><strong>Net: </strong>A TCP-based networking AP for creating servers and clients.</li>



<li><strong>Child Process:</strong> An API for spawning child processes, allowing developers to run external commands and scripts from within their applications.</li>
</ul>



<p>That&#8217;s a powerful set of tools right out of the box, not to mention when you add to with other external modules.</p>



<p>That&#8217;s right&#8230;NPM.</p>



<h3 class="wp-block-heading">NPM Ecosystem</h3>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="540" height="210" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/npm-logo.png" alt="what is node.js? The NPM ecosystem" class="wp-image-384" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/npm-logo.png 540w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/npm-logo-300x117.png 300w" sizes="(max-width: 540px) 100vw, 540px" /></figure>



<p>Node.js has a massive library of open-source 3rd party packages that provide developers with a fantastic set of tools to implement in their web applications.</p>



<p>They are managed using Node Package Manager AKA NPM, which makes it super easy to find, install, and use these open-source 3rd party packages.</p>



<p>Using Node.js regularly, I have to tell you NPM is fantastic. Very easy to find and implement packages that greatly enhanced my web application, such as React.js, Typescript, SASS, you name it &#8211; all integral parts to the app I was building.</p>



<h3 class="wp-block-heading">Scalability</h3>



<p>Node.js is designed to be highly scalable and can handle large-scale, high-performance applications with ease.</p>



<p>It is also easily scalable across multiple servers using a tool like Kubernetes.</p>



<h2 class="wp-block-heading">What is Node.js used for?</h2>



<p>So, with all of this in mind&#8230;what is Node.js actually used for?</p>



<p>In the past, I&#8217;ve personally used it to:</p>



<ul>
<li>Create multiple full-stack web applications using NPM packages that include Firebase, React, Vue, Typescript, SASS, CSS in Javascript, and many many more. </li>



<li>Created a frontend build system to be used across the team that built frontend assets and produced neatly packaged, production-ready code, ready for release.</li>
</ul>



<p>&#8230;but what about other developers? What do they use it for?</p>



<p>The answer is most aspects of web development.</p>



<ul>
<li>Web apps</li>



<li>Mobile apps</li>



<li>Streaming websites (because its architecture really lends itself to streaming &#8211; <a href="#how-does-nodejs-work" data-type="internal" data-id="#how-does-nodejs-work">see our how does Node.js work section for more details</a>).</li>



<li>Chat applications</li>



<li>API&#8217;s</li>
</ul>



<div class="recommendation" data-ad="GB"><span class="recommendation__top-pick">Our top pick</span><div class="recommendation__content"><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="stHeading recommendation__content__title" data-ad-click="Learn Node.js @ CodeAcademy heading" target="_blank" rel="noopener">Learn Node.js @ CodeAcademy</a><p class="recommendation__content__description">Check out easy-to-follow, interactive Node.js courses @ CodeAcademy (some are FREE)</p><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="btn btn--secondary recommendation__content__button" data-ad-click="Learn Node.js @ CodeAcademy button" target="_blank" rel="noopener">Sign Up Now</a><p class="recommendation__content__notice">If you click this link and make a purchase, we earn a commission at no additional cost to you.</p></div><div class="recommendation__image"><a href="https://www.pntrac.com/t/8-12462-301286-213588" data-ad-click="Learn Node.js @ CodeAcademy image" target="_blank" rel="noopener"><img loading="lazy" src="/wp-content/uploads/2023/03/code-academy.jpeg" width="300" height="300" alt="Learn Node.js @ CodeAcademy" /></a></div></div>



<h2 class="wp-block-heading">Why should I Use Node.js?</h2>



<p>So&#8230;why should you use Node.js? As you might be able to tell from previous in the article, there are good number of reasons.</p>



<p>Let&#8217;s break it down.</p>



<ul>
<li><strong>Fullstack.</strong> You can create frontend, backend, and full-stack applications, all using the same coding language.</li>



<li><strong>High performance.</strong> Using Node.js will enable you to build fast and highly scalable applications.</li>



<li><strong>There&#8217;s a large and active community. </strong>There are tonnes of packages available that are continuously being improved and updated to help developers with whatever application you&#8217;re building.</li>



<li><strong>Cross-platform.</strong> Because Node.js can be installed on most operating systems, it doesn&#8217;t matter what kind of laptop you or your team have &#8211; it&#8217;s just going to work.</li>
</ul>


<section class="subscribe stFlx">
        
        <section class="subscribe__content">
            <span class="subscribe__heading">Debug Your Dev Time!</span>
            <p>Take your career to the next level and sign up to our mailing list. I'll send you all the dev info you'll ever need: tips, tricks, tutorials, and much more.</p>
            <form method="post" class="stFlx stFlx--centre hero__form" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
                <div style="display: none;">
                    <input type="hidden" name="meta_web_form_id" value="718770369" />
                    <input type="hidden" name="meta_split_id" value="" />
                    <input type="hidden" name="listname" value="awlist5282620" />
                    <input type="hidden" name="redirect" value="https://www.thewebdeveloperguide.com/almost-done" id="redirect_d84f8b0f01936c977b27970141bc3b5f" />
        
                    <input type="hidden" name="meta_adtracking" value="webdeveloperguide_shortcode" />
                    <input type="hidden" name="meta_message" value="1" />
                    <input type="hidden" name="meta_required" value="email" />
                    <input type="hidden" name="meta_tooltip" value="" />
                </div>
                <input id="awf_field-101138743" type="text" name="email" placeholder="Your email address..." value="" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
                <input name="submit" type="submit"  class="btn" value="Send me all the dev info I'll ever need..."  />
                <div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=rBxMHAwMrByc" alt="" /></div>
            </form>
            <p class="hero__nospam">Don't worry, we won't spam you. We hate that too. We'll just send you useful information you can use and/or learn from. Pinky promise.</p>
        </section>
     </section>



<h2 class="wp-block-heading">Is Node.js a Programming Language or a Framework?</h2>



<p>So we have a grasp of what Node.js is and what it does, but what can we call it? What&#8217;s its label? </p>



<p>Is it a programming language? Definitely not.</p>



<p>Is it a framework? Some people do call Node.js a framework, but that&#8217;s not totally accurate. A framework is designed to provide developer tools to speed up development &#8211; Node.js does much more than that.</p>



<p><strong>Node.js is a runtime environment. </strong></p>



<p>Why? Because it&#8217;s a software infrastructure that interacts with the server&#8217;s operating system. This of course grants it access to tonnes of cool functionality, that you can get at by writing actual JavaScript.</p>



<p>Genius.</p>



<h2 class="wp-block-heading">Is Node.js Frontend or Backend?</h2>



<p>We&#8217;ve covered a lot of ground in this what is Node.js? the article already and some of my previous points have probably answered this question for you already.</p>



<p>But let&#8217;s make it crystal clear for the skim readers.</p>



<p>Is Node.js Frontend or Backend? The answer is <strong><em>yes &#8211; it&#8217;s both.</em></strong></p>



<p>Node.js is written in frontend code &#8211; JavaScript &#8211; but can actually build both backend and frontend solutions.</p>



<div class="article-snippet">
<p>Node.js is known for being a backend technology that’s written in frontend code, but the truth is that it contains both frontend and backend functionality.Node.js can also be used for frontend development with tools like React, Vue.js, and Angular that allow developers to build web applications using JavaScript on both the server and the client side. In these cases, Node.js is used as a build tool or bundling system, rather than as a runtime environment for executing server-side code.</p>



<h3 class="wp-block-heading" id="frontend-example">FRONTEND EXAMPLE</h3>



<figure class="wp-block-image size-large"><img decoding="async" loading="lazy" width="1024" height="399" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/webpack-logo-1024x399.png" alt="is node.js frontend or backend? Webpack logo for frontend example" class="wp-image-387" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/webpack-logo-1024x399.png 1024w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/webpack-logo-300x117.png 300w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/webpack-logo-768x299.png 768w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/webpack-logo-1536x598.png 1536w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/webpack-logo-2048x797.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>One great example, is a Webpack bundling system that’s essentially powered by Node and its vast collection of packages.With this, frontend developers can use the bundling system to combine a variety of different codes from React to Vue or from SASS to PostCSS. Also, you can use the Node packages to compile the latest JavaScript code to older JavaScript that’s more well supported on ancient web browsers – or Safari (it really is the new Internet Explorer).</p>



<h3 class="wp-block-heading">Backend Example</h3>



<p>A good backend example is to use a packages such as Express.js to build a faster and scalable API.</p>
</div>



<p>Now let&#8217;s take a look at some of the more popular packages that help us create frontend and backend applications.</p>



<div class="recommendation" data-ad="GB"><span class="recommendation__top-pick">Our top pick</span><div class="recommendation__content"><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="stHeading recommendation__content__title" data-ad-click="Learn Node.js @ CodeAcademy heading" target="_blank" rel="noopener">Learn Node.js @ CodeAcademy</a><p class="recommendation__content__description">Check out easy-to-follow, interactive Node.js courses @ CodeAcademy (some are FREE)</p><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="btn btn--secondary recommendation__content__button" data-ad-click="Learn Node.js @ CodeAcademy button" target="_blank" rel="noopener">Sign Up Now</a><p class="recommendation__content__notice">If you click this link and make a purchase, we earn a commission at no additional cost to you.</p></div><div class="recommendation__image"><a href="https://www.pntrac.com/t/8-12462-301286-213588" data-ad-click="Learn Node.js @ CodeAcademy image" target="_blank" rel="noopener"><img loading="lazy" src="/wp-content/uploads/2023/03/code-academy.jpeg" width="300" height="300" alt="Learn Node.js @ CodeAcademy" /></a></div></div>



<h2 class="wp-block-heading">Popular Node.js Packages and Uses</h2>



<p>To demonstrate the power and value of Node.js, I think it&#8217;s a good idea to take a brief look at some of the most popular packages available on the runtime.</p>



<h3 class="wp-block-heading">Express.js</h3>



<p>Arguably the most popular Node.js package available is <a href="https://thewebdeveloperguide.com/what-is-expressjs/" target="_blank" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-expressjs/" rel="noreferrer noopener">Express.js</a>.</p>



<p><a href="https://thewebdeveloperguide.com/what-is-expressjs/" target="_blank" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-expressjs/" rel="noreferrer noopener">Express.js</a> is a fast, unopinionated, and minimalist web application framework. </p>



<p>The framework provides a set of features and tools that make it easier to build web applications and APIs using Node.js.</p>



<p>Because <a href="https://thewebdeveloperguide.com/what-is-expressjs/" target="_blank" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-expressjs/" rel="noreferrer noopener">Express.js</a> is a minimalist framework, it provides a lot of flexibility and customisation options for developers. It is built on top of the Node.js built-in HTTP module and provides an easy-to-use API for handling HTTP requests and responses, routing requests, and serving static files.</p>



<p><a href="https://thewebdeveloperguide.com/what-is-expressjs/" target="_blank" data-type="URL" data-id="https://thewebdeveloperguide.com/what-is-expressjs/" rel="noreferrer noopener">Express.js</a> has become the go-to framework for building web applications with Node.js.</p>



<h3 class="wp-block-heading">Socket.io</h3>



<p><a href="https://socket.io/" data-type="URL" data-id="https://socket.io/" target="_blank" rel="noreferrer noopener">Socket.io</a> is a real-time, bidirectional, and event-based communication library.</p>



<p>What the hell does that mean? It means developers use it to build real-time communication apps such as chat, online gaming, and collaboration tools.</p>



<h3 class="wp-block-heading">Moment</h3>



<p><a href="https://momentjs.com/" data-type="URL" data-id="https://momentjs.com/" target="_blank" rel="noreferrer noopener">Moment </a>is a lightweight JavaScript data library that makes working with dates a breeze.</p>



<p>Anyone who&#8217;s ever worked with dates and times in JavaScript knows one thing: it&#8217;s a nightmare.</p>



<p><a href="https://momentjs.com/" target="_blank" data-type="URL" data-id="https://momentjs.com/" rel="noreferrer noopener">Moment</a> makes the whole thing easy. It provides a great API that supports a wide range of date and time formats, time zones, and more.</p>



<h3 class="wp-block-heading">Lodash</h3>



<p>Lodash is a JavaScript utility library that provides a collection of functions for dealing with datatypes such as Arrays, objects etc. </p>



<p>It&#8217;s designed to make common coding tasks easier and more efficient by providing a fantastic set of functions that can be used in a wide variety of products.</p>


<section class="subscribe stFlx">
        
        <section class="subscribe__content">
            <span class="subscribe__heading">Debug Your Dev Time!</span>
            <p>Take your career to the next level and sign up to our mailing list. I'll send you all the dev info you'll ever need: tips, tricks, tutorials, and much more.</p>
            <form method="post" class="stFlx stFlx--centre hero__form" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
                <div style="display: none;">
                    <input type="hidden" name="meta_web_form_id" value="718770369" />
                    <input type="hidden" name="meta_split_id" value="" />
                    <input type="hidden" name="listname" value="awlist5282620" />
                    <input type="hidden" name="redirect" value="https://www.thewebdeveloperguide.com/almost-done" id="redirect_d84f8b0f01936c977b27970141bc3b5f" />
        
                    <input type="hidden" name="meta_adtracking" value="webdeveloperguide_shortcode" />
                    <input type="hidden" name="meta_message" value="1" />
                    <input type="hidden" name="meta_required" value="email" />
                    <input type="hidden" name="meta_tooltip" value="" />
                </div>
                <input id="awf_field-101138743" type="text" name="email" placeholder="Your email address..." value="" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
                <input name="submit" type="submit"  class="btn" value="Send me all the dev info I'll ever need..."  />
                <div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=rBxMHAwMrByc" alt="" /></div>
            </form>
            <p class="hero__nospam">Don't worry, we won't spam you. We hate that too. We'll just send you useful information you can use and/or learn from. Pinky promise.</p>
        </section>
     </section>



<h2 class="wp-block-heading">Getting started with Node.js</h2>



<p>Now we&#8217;re all hyped about what Node.js is and what it does, let&#8217;s take a look at how to get started.</p>



<h3 class="wp-block-heading">Download Node.js</h3>



<p>First, let&#8217;s download Node.js.</p>



<p>If you go to the <a href="https://nodejs.org/en" target="_blank" data-type="URL" data-id="https://nodejs.org/en" rel="noreferrer noopener">Node.js homepage</a>, you should be confronted straight away with download options suitable for your operating system.</p>



<p>For me, on Linux, I got this:</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" loading="lazy" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Screenshot-from-2023-03-22-12-01-57.png" alt="what is node.js? Getting started with Node.js" class="wp-image-355" width="766" height="426" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Screenshot-from-2023-03-22-12-01-57.png 766w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Screenshot-from-2023-03-22-12-01-57-300x167.png 300w" sizes="(max-width: 766px) 100vw, 766px" /></figure>



<p>Select an option that suits you (I usually for the current option), downloaded it and install it as you would any piece of software.</p>



<p>With Node.js installed, let&#8217;s create a standard &#8216;hello world&#8217; app. </p>



<h3 class="wp-block-heading">How to Create a simple App?</h3>



<p>So here&#8217;s what we&#8217;re going to do:</p>



<ul>
<li>Create a JavaScript file that uses Node.js&#8217;s HTTP module to create a local server.</li>



<li>Tell that server to create an HTML file.</li>



<li>Write &#8216;hello world&#8217; in the file.</li>
</ul>



<p>Let&#8217;s do it &#8211; you&#8217;re not going to believe how easy this is.</p>



<h4 class="wp-block-heading">Step 1: Create the JavaScript File</h4>



<p>In a directory where you want to run this, create a JavaScript file. Call it what you like. I called mine main.js.</p>



<p>In that file, type (or copy) the following:</p>



<pre class="wp-block-code"><code>const http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end('Hello World!');
}).listen(8080);</code></pre>



<p>Here we&#8217;re creating a server instance, creating the HTML and its content, and telling the server to display this content on port 8080.</p>



<h4 class="wp-block-heading">Step 2: Run the server</h4>



<p>Now that we&#8217;ve programmatically told Node.js to create the server, let&#8217;s get Node running it.</p>



<p>In your command line tool of choice (terminal in Visual Studio Code is pretty good if you&#8217;re not used to command line stuff) change directory to where your JavaScript file is.</p>



<p>Then type:</p>



<pre class="wp-block-code"><code>node &lt;filename&gt;.js</code></pre>



<p>So for me, this was:</p>



<pre class="wp-block-code"><code>node main.js</code></pre>



<h4 class="wp-block-heading">Step 3: Fire it up</h4>



<p>Now the only thing to do is to fire this bad boy up.</p>



<p>Open a web browser and type http://localhost:8080 into the address bar.</p>



<p>You should see something like this:</p>



<figure class="wp-block-image size-full"><img decoding="async" loading="lazy" width="474" height="133" src="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Screenshot-from-2023-03-22-15-58-22.png" alt="what is node.js? Firing up localhost:8080 after creating a server in node.js" class="wp-image-360" srcset="https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Screenshot-from-2023-03-22-15-58-22.png 474w, https://thewebdeveloperguide.com/wp-content/uploads/2023/03/Screenshot-from-2023-03-22-15-58-22-300x84.png 300w" sizes="(max-width: 474px) 100vw, 474px" /></figure>



<p>And it really is as simple as that.</p>



<div class="recommendation" data-ad="GB"><span class="recommendation__top-pick">Our top pick</span><div class="recommendation__content"><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="stHeading recommendation__content__title" data-ad-click="Learn Node.js @ CodeAcademy heading" target="_blank" rel="noopener">Learn Node.js @ CodeAcademy</a><p class="recommendation__content__description">Check out easy-to-follow, interactive Node.js courses @ CodeAcademy (some are FREE)</p><a href="https://www.pntrac.com/t/8-12462-301286-213588" class="btn btn--secondary recommendation__content__button" data-ad-click="Learn Node.js @ CodeAcademy button" target="_blank" rel="noopener">Sign Up Now</a><p class="recommendation__content__notice">If you click this link and make a purchase, we earn a commission at no additional cost to you.</p></div><div class="recommendation__image"><a href="https://www.pntrac.com/t/8-12462-301286-213588" data-ad-click="Learn Node.js @ CodeAcademy image" target="_blank" rel="noopener"><img loading="lazy" src="/wp-content/uploads/2023/03/code-academy.jpeg" width="300" height="300" alt="Learn Node.js @ CodeAcademy" /></a></div></div>



<h2 class="wp-block-heading">So&#8230;What is Node.js?</h2>



<p>Wow. That&#8217;s a lot of info, but all of it is necessary when answering the &#8216;what is node.js&#8217; question in great detail.</p>



<p>If you&#8217;ve skipped to the end of this article looking for quick answers, let me summarise exactly what Node.js is.</p>



<ul>
<li>Node.js is a server-side JavaScript runtime that can be used to create backend and frontend web applications such as web applications, chat applications, APIs or streaming applications.</li>



<li>Node.js is built on Chrome&#8217;s powerful V8 JavaScript engine.</li>



<li>Node.js&#8217;s event-driven, non-blocking I/O architecture, makes it the perfect choice for speed, high volumes of data traffic, and real-time data management.</li>



<li>Node.js is great because it has fantastic cross-platform compatibility, it&#8217;s easily scalable,  comes with a number of built-in modules, comes with a package management system that provides access to thousands more useful modules, and has a very active community.</li>



<li>Node.js is easy to pick up and learn.</li>
</ul>



<h2 class="wp-block-heading">Further Reading</h2>



<ul>
<li><a href="https://nodejs.org/en/about/" target="_blank" rel="noreferrer noopener">Node.Js</a></li>



<li><a href="https://en.wikipedia.org/wiki/Node.js" data-type="URL" data-id="https://en.wikipedia.org/wiki/Node.js" target="_blank" rel="noreferrer noopener">Node.Js Wikipedia entry</a></li>



<li><a href="https://dev.to/macargnelutti/server-side-javascript-a-decade-before-node-js-with-netscape-livewire-l72" data-type="URL" data-id="https://dev.to/macargnelutti/server-side-javascript-a-decade-before-node-js-with-netscape-livewire-l72" target="_blank" rel="noreferrer noopener">Server-side JavaScript a decade before Node.js with Netscape LiveWire</a></li>
</ul>


<section class="subscribe stFlx">
        
        <section class="subscribe__content">
            <span class="subscribe__heading">Debug Your Dev Time!</span>
            <p>Take your career to the next level and sign up to our mailing list. I'll send you all the dev info you'll ever need: tips, tricks, tutorials, and much more.</p>
            <form method="post" class="stFlx stFlx--centre hero__form" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl"  >
                <div style="display: none;">
                    <input type="hidden" name="meta_web_form_id" value="718770369" />
                    <input type="hidden" name="meta_split_id" value="" />
                    <input type="hidden" name="listname" value="awlist5282620" />
                    <input type="hidden" name="redirect" value="https://www.thewebdeveloperguide.com/almost-done" id="redirect_d84f8b0f01936c977b27970141bc3b5f" />
        
                    <input type="hidden" name="meta_adtracking" value="webdeveloperguide_shortcode" />
                    <input type="hidden" name="meta_message" value="1" />
                    <input type="hidden" name="meta_required" value="email" />
                    <input type="hidden" name="meta_tooltip" value="" />
                </div>
                <input id="awf_field-101138743" type="text" name="email" placeholder="Your email address..." value="" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
                <input name="submit" type="submit"  class="btn" value="Send me all the dev info I'll ever need..."  />
                <div style="display: none;"><img src="https://forms.aweber.com/form/displays.htm?id=rBxMHAwMrByc" alt="" /></div>
            </form>
            <p class="hero__nospam">Don't worry, we won't spam you. We hate that too. We'll just send you useful information you can use and/or learn from. Pinky promise.</p>
        </section>
     </section>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
