<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Prashanth K.S</title>
    <description>The latest articles on Forem by Prashanth K.S (@iam_prashanth_ks).</description>
    <link>https://forem.com/iam_prashanth_ks</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2981256%2F7c1032cf-02f7-4426-9120-c9c939634c69.jpg</url>
      <title>Forem: Prashanth K.S</title>
      <link>https://forem.com/iam_prashanth_ks</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/iam_prashanth_ks"/>
    <language>en</language>
    <item>
      <title>What is the difference between React and React Native</title>
      <dc:creator>Prashanth K.S</dc:creator>
      <pubDate>Tue, 15 Apr 2025 03:24:32 +0000</pubDate>
      <link>https://forem.com/iam_prashanth_ks/what-is-the-difference-between-react-and-react-native-510g</link>
      <guid>https://forem.com/iam_prashanth_ks/what-is-the-difference-between-react-and-react-native-510g</guid>
      <description>&lt;p&gt;Great question! Here's a clear and simple breakdown of the &lt;strong&gt;difference between React and React Native&lt;/strong&gt;:&lt;/p&gt;




&lt;h3&gt;
  
  
  🟦 &lt;strong&gt;React (aka ReactJS)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is&lt;/strong&gt;: A JavaScript &lt;strong&gt;library&lt;/strong&gt; for building &lt;strong&gt;user interfaces&lt;/strong&gt;, mainly for &lt;strong&gt;web applications&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Platform&lt;/strong&gt;: &lt;strong&gt;Browsers&lt;/strong&gt; (Chrome, Firefox, Safari, etc.)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Case&lt;/strong&gt;: Building interactive websites and web apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rendering&lt;/strong&gt;: Outputs &lt;strong&gt;HTML, CSS&lt;/strong&gt;, and JavaScript in the browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Websites like Facebook, Instagram (web version), Airbnb.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  📱 &lt;strong&gt;React Native&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is&lt;/strong&gt;: A &lt;strong&gt;framework&lt;/strong&gt; for building &lt;strong&gt;mobile apps&lt;/strong&gt; using React principles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Platform&lt;/strong&gt;: &lt;strong&gt;Mobile (iOS and Android)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Case&lt;/strong&gt;: Building cross-platform mobile apps from a single codebase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rendering&lt;/strong&gt;: Uses &lt;strong&gt;native mobile components&lt;/strong&gt; (not HTML), like &lt;code&gt;&amp;lt;View&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;Text&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;Button&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Example&lt;/strong&gt;: Apps like Facebook, Instagram, and Shopify mobile apps.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🧠 Summary:
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;React (ReactJS)&lt;/th&gt;
&lt;th&gt;React Native&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Platform&lt;/td&gt;
&lt;td&gt;Web browsers&lt;/td&gt;
&lt;td&gt;iOS &amp;amp; Android mobile devices&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output&lt;/td&gt;
&lt;td&gt;HTML &amp;amp; CSS&lt;/td&gt;
&lt;td&gt;Native mobile components&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Styling&lt;/td&gt;
&lt;td&gt;CSS&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;StyleSheet.create&lt;/code&gt; (JS-based)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Navigation&lt;/td&gt;
&lt;td&gt;React Router&lt;/td&gt;
&lt;td&gt;React Navigation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Goal&lt;/td&gt;
&lt;td&gt;Build websites&lt;/td&gt;
&lt;td&gt;Build mobile apps&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  ✅ Common Ground:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Both use &lt;strong&gt;JavaScript&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Both use &lt;strong&gt;components&lt;/strong&gt;, &lt;strong&gt;props&lt;/strong&gt;, &lt;strong&gt;state&lt;/strong&gt;, and &lt;strong&gt;hooks&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If you know React, you can learn React Native faster!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know if you’d like a visual comparison or beginner roadmap for either! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>react</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Git &amp; GitHub Beginner Tutorial</title>
      <dc:creator>Prashanth K.S</dc:creator>
      <pubDate>Mon, 07 Apr 2025 11:39:05 +0000</pubDate>
      <link>https://forem.com/iam_prashanth_ks/git-github-beginner-tutorial-1hde</link>
      <guid>https://forem.com/iam_prashanth_ks/git-github-beginner-tutorial-1hde</guid>
      <description>&lt;p&gt;Git is a &lt;strong&gt;version control system&lt;/strong&gt; — it helps you &lt;strong&gt;save&lt;/strong&gt;, &lt;strong&gt;track&lt;/strong&gt;, and &lt;strong&gt;manage changes&lt;/strong&gt; in your code.&lt;br&gt;&lt;br&gt;
GitHub is a &lt;strong&gt;cloud service&lt;/strong&gt; where you can &lt;strong&gt;upload your Git projects&lt;/strong&gt; and &lt;strong&gt;collaborate&lt;/strong&gt; with others.&lt;/p&gt;

&lt;p&gt;Let's learn the basics!&lt;/p&gt;


&lt;h1&gt;
  
  
  📦 Step 1: Install Git
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Download Git: &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;git-scm.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Install it with default settings.&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;
  
  
  🗂️ Step 2: Basic Git Commands
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Command&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;What it does&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start a new Git project in your folder.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git clone&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Copy a project from GitHub to your computer.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git clone https://github.com/user/repo.git&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git add&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stage (save) files to be committed.&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;git add .&lt;/code&gt; (add all files)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git commit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Save a snapshot of your staged files.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git commit -m "Your message"&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Check the status of your project.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git push&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Send your code to GitHub.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git push origin main&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Get the latest changes from GitHub.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git pull origin main&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git remote&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Manage connections to GitHub repositories.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git remote add origin URL&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git branch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List or create branches.&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;git branch&lt;/code&gt; / &lt;code&gt;git branch new-branch&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git checkout&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Switch between branches.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git checkout branch-name&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git diff&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;See the changes you made compared to the last commit.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git diff&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git merge&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Merge changes from one branch into another.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git merge branch-name&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cd ..&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move up one folder in your terminal.&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cd ..&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h1&gt;
  
  
  🚀 Step 3: Common Git Workflow
&lt;/h1&gt;

&lt;p&gt;Here’s a typical workflow you might follow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Clone the project&lt;/strong&gt; (if it already exists):
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone https://github.com/username/project.git
   &lt;span class="nb"&gt;cd &lt;/span&gt;project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create a new project&lt;/strong&gt; (if starting fresh):
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;mkdir &lt;/span&gt;project
   &lt;span class="nb"&gt;cd &lt;/span&gt;project
   git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Make some changes&lt;/strong&gt; (edit files, create code).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;See what changed&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Stage the changes&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Commit the changes&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Push the code to GitHub&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, connect your GitHub repository:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; git remote add origin https://github.com/username/project.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Then push:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt; git push origin main
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Working with branches&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new branch:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; git branch new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Switch to it:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; git checkout new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Merge it later:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; git checkout main
 git merge new-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pull latest changes from GitHub&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git pull origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;See differences&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  🎯 Important Notes
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;git init&lt;/strong&gt; is for &lt;em&gt;new&lt;/em&gt; projects.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;git clone&lt;/strong&gt; is for &lt;em&gt;existing&lt;/em&gt; projects.
&lt;/li&gt;
&lt;li&gt;Always use &lt;strong&gt;git add&lt;/strong&gt; and &lt;strong&gt;git commit&lt;/strong&gt; to save changes locally.
&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;git push&lt;/strong&gt; to upload your commits to GitHub.
&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;git pull&lt;/strong&gt; to download new changes from GitHub.
&lt;/li&gt;
&lt;li&gt;Branches help you &lt;em&gt;work on new features&lt;/em&gt; without messing up your main project.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  ✨ Bonus Tip
&lt;/h1&gt;

&lt;p&gt;🔒 Always commit meaningful messages like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add login form UI"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"stuff"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Would you also like me to create a &lt;strong&gt;cheat sheet image&lt;/strong&gt; 📄 you can save for quick reference?&lt;br&gt;&lt;br&gt;
Let me know! 🚀&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>List of Essential Terminal Commands for Windows Users (Command Prompt &amp; PowerShell)</title>
      <dc:creator>Prashanth K.S</dc:creator>
      <pubDate>Thu, 03 Apr 2025 06:16:16 +0000</pubDate>
      <link>https://forem.com/iam_prashanth_ks/list-of-essential-terminal-commands-for-windows-users-command-prompt-powershell-1cg3</link>
      <guid>https://forem.com/iam_prashanth_ks/list-of-essential-terminal-commands-for-windows-users-command-prompt-powershell-1cg3</guid>
      <description>&lt;p&gt;Windows users can execute commands using &lt;strong&gt;Command Prompt (cmd)&lt;/strong&gt; or &lt;strong&gt;PowerShell&lt;/strong&gt;. Below is a list of commonly used commands:  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;1. File &amp;amp; Directory Management&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mkdir&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create a new directory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mkdir NewFolder&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;rmdir /s&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Delete a directory and its contents&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rmdir /s OldFolder&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;del&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Delete a file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;del file.txt&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;copy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Copy a file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;copy source.txt destination.txt&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;move&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move or rename a file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;move file.txt C:\NewLocation&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dir&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List files in a directory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;dir C:\Users&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Change directory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cd Documents&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cd ..&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Move up one directory&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cd ..&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cls&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Clear terminal screen&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cls&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tree&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Display directory structure&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tree&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;new-item&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create a new file&lt;/td&gt;
&lt;td&gt;new-item injex.js&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;2. System Information &amp;amp; Control&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;systeminfo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Display system details&lt;/td&gt;
&lt;td&gt;&lt;code&gt;systeminfo&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;hostname&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show computer name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hostname&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;echo %USERNAME%&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Display current user&lt;/td&gt;
&lt;td&gt;&lt;code&gt;echo %USERNAME%&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tasklist&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List running processes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tasklist&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;taskkill /IM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Kill a process by name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;taskkill /IM notepad.exe /F&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;shutdown /s /t 0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shut down the system&lt;/td&gt;
&lt;td&gt;&lt;code&gt;shutdown /s /t 0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;shutdown /r /t 0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Restart the system&lt;/td&gt;
&lt;td&gt;&lt;code&gt;shutdown /r /t 0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;3. Network &amp;amp; Internet Commands&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ipconfig&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show network configuration&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ipconfig&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ipconfig /all&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Detailed network info&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ipconfig /all&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ipconfig /release&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Release IP address&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ipconfig /release&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ipconfig /renew&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Renew IP address&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ipconfig /renew&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ping&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Check network connection&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ping google.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tracert&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Trace route to a server&lt;/td&gt;
&lt;td&gt;&lt;code&gt;tracert google.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;netstat -an&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View network connections&lt;/td&gt;
&lt;td&gt;&lt;code&gt;netstat -an&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nslookup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Get domain IP info&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nslookup google.com&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;4. Disk &amp;amp; Storage Commands&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;chkdsk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Check disk for errors&lt;/td&gt;
&lt;td&gt;&lt;code&gt;chkdsk C:&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;diskpart&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Open disk partition manager&lt;/td&gt;
&lt;td&gt;&lt;code&gt;diskpart&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;format&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Format a drive&lt;/td&gt;
&lt;td&gt;&lt;code&gt;format D:&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wmic logicaldisk get name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List all drives&lt;/td&gt;
&lt;td&gt;&lt;code&gt;wmic logicaldisk get name&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;5. User &amp;amp; Permission Management&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;whoami&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show current user&lt;/td&gt;
&lt;td&gt;&lt;code&gt;whoami&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List users&lt;/td&gt;
&lt;td&gt;&lt;code&gt;net user&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net user username password&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Change user password&lt;/td&gt;
&lt;td&gt;&lt;code&gt;net user John newpassword&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;net localgroup&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Show user groups&lt;/td&gt;
&lt;td&gt;&lt;code&gt;net localgroup&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;6. PowerShell-Specific Commands&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For &lt;strong&gt;advanced users&lt;/strong&gt;, PowerShell provides more functionality than cmd. Some useful PowerShell commands:  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;PowerShell Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Get-Help&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Get help for a command&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Get-Help Get-Process&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Get-Process&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List running processes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Get-Process&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Stop-Process -Name&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Kill a process&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Stop-Process -Name Notepad&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Get-Service&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List services&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Get-Service&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Restart-Computer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Restart the system&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Restart-Computer&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Get-EventLog -LogName System&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View system logs&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Get-EventLog -LogName System&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;These commands help Windows users navigate the terminal efficiently. Whether you're managing files, checking system info, or troubleshooting networks, &lt;strong&gt;Command Prompt and PowerShell&lt;/strong&gt; make it easy to control your system. 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Synchronous vs Asynchronous in JavaScript Functions</title>
      <dc:creator>Prashanth K.S</dc:creator>
      <pubDate>Wed, 02 Apr 2025 07:42:31 +0000</pubDate>
      <link>https://forem.com/iam_prashanth_ks/synchronous-vs-asynchronous-in-javascript-functions-3am4</link>
      <guid>https://forem.com/iam_prashanth_ks/synchronous-vs-asynchronous-in-javascript-functions-3am4</guid>
      <description>&lt;p&gt;JavaScript is &lt;strong&gt;single-threaded&lt;/strong&gt;, meaning it executes one task at a time. However, it supports &lt;strong&gt;asynchronous programming&lt;/strong&gt; to handle tasks efficiently. Let’s break it down:  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;1. Synchronous Functions (Blocking)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In &lt;strong&gt;synchronous execution&lt;/strong&gt;, JavaScript runs code &lt;strong&gt;line by line&lt;/strong&gt;, waiting for each operation to complete before moving to the next one.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Example of Synchronous Code&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;syncFunction&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Processing...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;syncFunction&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;End&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Output&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start
Processing...
End
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✔️ Each statement executes &lt;strong&gt;sequentially&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
❌ If one operation takes time (like reading a file), it &lt;strong&gt;blocks&lt;/strong&gt; further execution.  &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Problem with Synchronous Code&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If a function takes too long (e.g., fetching data from a server), the entire program &lt;strong&gt;pauses&lt;/strong&gt; until it’s done, making the app unresponsive.  &lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;2. Asynchronous Functions (Non-Blocking)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Asynchronous execution&lt;/strong&gt; allows JavaScript to continue running other tasks &lt;strong&gt;without waiting&lt;/strong&gt; for long-running operations to finish.  &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;How Does It Work?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JavaScript delegates long tasks&lt;/strong&gt; (like fetching data, reading files) to the &lt;strong&gt;Web APIs or Node.js APIs&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Once the task is complete, JavaScript &lt;strong&gt;resumes execution&lt;/strong&gt; using &lt;strong&gt;callbacks, promises, or async/await&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Example of Asynchronous Code&lt;/strong&gt;
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Processing...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Executes after 2 seconds&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;End&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Output&lt;/strong&gt;
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start
End
Processing... (after 2 seconds)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;✔️ The &lt;strong&gt;setTimeout()&lt;/strong&gt; function executes &lt;strong&gt;after&lt;/strong&gt; 2 seconds, while the rest of the code &lt;strong&gt;continues&lt;/strong&gt; running.&lt;br&gt;&lt;br&gt;
✔️ JavaScript &lt;strong&gt;doesn’t block execution&lt;/strong&gt;, improving efficiency.  &lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;3. Differences Between Synchronous &amp;amp; Asynchronous Execution&lt;/strong&gt;
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Synchronous (Blocking)&lt;/th&gt;
&lt;th&gt;Asynchronous (Non-Blocking)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Execution&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Line by line&lt;/td&gt;
&lt;td&gt;Moves to the next task while waiting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Slower (blocks execution)&lt;/td&gt;
&lt;td&gt;Faster (non-blocking)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Use Case&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Simple operations&lt;/td&gt;
&lt;td&gt;Fetching data, API calls, file handling&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Normal functions&lt;/td&gt;
&lt;td&gt;Callbacks, Promises, async/await&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;4. Asynchronous Handling Methods&lt;/strong&gt;
&lt;/h2&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;4.1 Callbacks&lt;/strong&gt; (Old Approach)
&lt;/h3&gt;

&lt;p&gt;A function is passed as an argument and executes after a task is completed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Data Fetched&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Process Completed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;End&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start
End
Data Fetched (after 2s)
Process Completed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❌ &lt;strong&gt;Callback Hell:&lt;/strong&gt; Nesting too many callbacks makes the code hard to read and maintain.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4.2 Promises&lt;/strong&gt; (Better Approach)
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;Promise&lt;/strong&gt; represents a future value that can be &lt;strong&gt;fulfilled&lt;/strong&gt; or &lt;strong&gt;rejected&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Data Fetched&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;End&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✔️ More readable than callbacks.&lt;br&gt;&lt;br&gt;
✔️ Supports &lt;strong&gt;&lt;code&gt;.then()&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;.catch()&lt;/code&gt;&lt;/strong&gt; for error handling.  &lt;/p&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;4.3 Async/Await&lt;/strong&gt; (Best Approach)
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;async/await&lt;/strong&gt; syntax makes asynchronous code look synchronous and more readable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Data Fetched&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;processData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Processing...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Waits here until the promise resolves&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Process Completed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;processData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;End&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✔️ &lt;strong&gt;Easy to read and maintain&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✔️ &lt;strong&gt;Avoids callback hell&lt;/strong&gt;  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;5. When to Use Synchronous vs Asynchronous?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;Use Synchronous&lt;/strong&gt; for:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple tasks like calculations or updating UI.
&lt;/li&gt;
&lt;li&gt;Small scripts where blocking is not an issue.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✅ &lt;strong&gt;Use Asynchronous&lt;/strong&gt; for:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;API calls&lt;/strong&gt; (fetching data from a server).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database operations&lt;/strong&gt; (saving/loading data).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File reading/writing&lt;/strong&gt; (to prevent UI freezing).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time applications&lt;/strong&gt; (like chat apps, stock trading apps).
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;🔹 &lt;strong&gt;Synchronous&lt;/strong&gt; code runs sequentially and blocks execution.&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;Asynchronous&lt;/strong&gt; code allows JavaScript to handle multiple tasks &lt;strong&gt;without waiting&lt;/strong&gt;, improving efficiency.&lt;br&gt;&lt;br&gt;
🔹 Use &lt;strong&gt;Promises or async/await&lt;/strong&gt; for better readability and performance.  &lt;/p&gt;

&lt;p&gt;🚀 &lt;strong&gt;Modern JavaScript applications mostly rely on asynchronous execution for better speed and responsiveness.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What is Node.js ? Explained in simple terms</title>
      <dc:creator>Prashanth K.S</dc:creator>
      <pubDate>Wed, 02 Apr 2025 06:00:41 +0000</pubDate>
      <link>https://forem.com/iam_prashanth_ks/what-is-nodejs-explained-in-simple-terms-179b</link>
      <guid>https://forem.com/iam_prashanth_ks/what-is-nodejs-explained-in-simple-terms-179b</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;1. Introduction to Node.js&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Node.js is an open-source, cross-platform &lt;strong&gt;JavaScript runtime environment&lt;/strong&gt; that allows developers to run JavaScript code &lt;strong&gt;outside the browser&lt;/strong&gt;. Built on Chrome’s &lt;strong&gt;V8 JavaScript engine&lt;/strong&gt;, it is widely used for building &lt;strong&gt;server-side applications&lt;/strong&gt;, APIs, real-time applications, and microservices.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✅ Asynchronous and event-driven&lt;br&gt;&lt;br&gt;
✅ Non-blocking I/O model&lt;br&gt;&lt;br&gt;
✅ High scalability and performance&lt;br&gt;&lt;br&gt;
✅ Uses JavaScript for both frontend &amp;amp; backend development  &lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;2. Why Use Node.js?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Node.js is a powerful platform that brings &lt;strong&gt;high performance&lt;/strong&gt; and &lt;strong&gt;efficiency&lt;/strong&gt; to web applications. Here’s why developers prefer it:  &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;2.1 High Performance&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Uses the &lt;strong&gt;V8 JavaScript engine&lt;/strong&gt;, which compiles JavaScript to machine code for faster execution.
&lt;/li&gt;
&lt;li&gt;Asynchronous, non-blocking execution means better resource utilization.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;2.2 Single Programming Language&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Allows &lt;strong&gt;JavaScript for both frontend &amp;amp; backend&lt;/strong&gt;, reducing complexity.
&lt;/li&gt;
&lt;li&gt;Developers don’t need to learn multiple languages for full-stack development.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;2.3 Non-Blocking I/O Model&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Uses &lt;strong&gt;event-driven architecture&lt;/strong&gt; for handling multiple requests simultaneously.
&lt;/li&gt;
&lt;li&gt;Unlike traditional web servers (like PHP or ASP.NET), it doesn’t block the execution thread.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;2.4 Scalable and Lightweight&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Perfect for real-time applications like &lt;strong&gt;chat apps, streaming services, and IoT applications&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Works well for microservices architecture due to its lightweight nature.
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;2.5 Rich Ecosystem (NPM)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Node.js has &lt;strong&gt;NPM (Node Package Manager)&lt;/strong&gt;, with over &lt;strong&gt;2 million open-source packages&lt;/strong&gt; for rapid development.
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;3. How Node.js Works? (Architecture)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Node.js follows an &lt;strong&gt;event-driven, non-blocking I/O model&lt;/strong&gt; powered by the &lt;strong&gt;libuv&lt;/strong&gt; library.  &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;3.1 Event-Driven Architecture&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Node.js runs a &lt;strong&gt;single-threaded event loop&lt;/strong&gt; that listens for events and delegates tasks to worker threads when needed.  &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;3.2 Non-Blocking I/O&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When an I/O request (like database calls, file reading, or API requests) is made, Node.js &lt;strong&gt;doesn’t wait&lt;/strong&gt; for the response.
&lt;/li&gt;
&lt;li&gt;Instead, it moves on to the next task and processes the response asynchronously when it’s ready.
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;4. Installing Node.js&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To use Node.js, follow these steps:  &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;4.1 Download &amp;amp; Install&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;official Node.js website&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;Download the &lt;strong&gt;LTS (Long-Term Support)&lt;/strong&gt; version.
&lt;/li&gt;
&lt;li&gt;Install it by following the instructions for your OS (Windows, Mac, Linux).
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;4.2 Verify Installation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Open a terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Node.js is installed, it will display the version number.  &lt;/p&gt;

&lt;p&gt;To check &lt;strong&gt;NPM (Node Package Manager)&lt;/strong&gt; version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;5. Creating Your First Node.js Application&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;5.1 Hello World in Node.js&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Create a file &lt;code&gt;app.js&lt;/code&gt; and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Importing the HTTP module&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;http&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Creating a server&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createServer&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeHead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;text/plain&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello, World! Welcome to Node.js!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Running the server on port 3000&lt;/span&gt;
&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Server running at http://localhost:3000/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the file in terminal using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node app.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, open a browser and go to &lt;strong&gt;&lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;&lt;/strong&gt;. You will see &lt;strong&gt;"Hello, World! Welcome to Node.js!"&lt;/strong&gt;  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;6. Node.js Core Modules&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Node.js comes with several &lt;strong&gt;built-in modules&lt;/strong&gt; to perform different tasks.  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Module&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;http&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create web servers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;File system operations (read/write files)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;path&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Work with file paths&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;os&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Get OS-related information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;events&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Handle events in an application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;crypto&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Perform encryption and hashing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Reading a file using the &lt;code&gt;fs&lt;/code&gt; module&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test.txt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;7. Node.js with Express.js&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Express.js&lt;/strong&gt; is the most popular framework for Node.js, used to build web applications and RESTful APIs.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Installing Express.js&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;express
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Basic Express.js Server&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Define a simple route&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello, Express.js!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Start the server&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Server running at http://localhost:3000/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;8. Real-World Applications of Node.js&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Node.js is used in various industries for different applications.  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Application Type&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Real-time Chat Apps&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WhatsApp Web, Discord, Slack&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Streaming Services&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Netflix, YouTube, Twitch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;E-commerce Platforms&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;eBay, Walmart, AliExpress&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Social Media&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LinkedIn, Twitter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IoT Applications&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Smart Home Automation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;9. Advantages &amp;amp; Disadvantages of Node.js&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Advantages&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✔️ &lt;strong&gt;Fast Performance&lt;/strong&gt; – Uses V8 engine &amp;amp; asynchronous execution.&lt;br&gt;&lt;br&gt;
✔️ &lt;strong&gt;Scalability&lt;/strong&gt; – Perfect for handling high traffic applications.&lt;br&gt;&lt;br&gt;
✔️ &lt;strong&gt;Full-Stack JavaScript&lt;/strong&gt; – One language for frontend &amp;amp; backend.&lt;br&gt;&lt;br&gt;
✔️ &lt;strong&gt;Large Ecosystem&lt;/strong&gt; – Rich library support via NPM.&lt;br&gt;&lt;br&gt;
✔️ &lt;strong&gt;Community Support&lt;/strong&gt; – Huge open-source community.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Disadvantages&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;❌ &lt;strong&gt;Single-Threaded Limitation&lt;/strong&gt; – Not ideal for CPU-intensive tasks.&lt;br&gt;&lt;br&gt;
❌ &lt;strong&gt;Callback Hell&lt;/strong&gt; – Too many nested callbacks can make code hard to read.&lt;br&gt;&lt;br&gt;
❌ &lt;strong&gt;Security Concerns&lt;/strong&gt; – Poorly managed third-party packages can pose security risks.  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;10. When to Use Node.js?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;✅ &lt;strong&gt;Best for:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real-time applications&lt;/strong&gt; (Chats, gaming, streaming)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Microservices architecture&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;APIs and RESTful services&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single-page applications (SPAs)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🚫 &lt;strong&gt;Not recommended for:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CPU-intensive applications&lt;/strong&gt; (e.g., AI, Machine Learning)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Heavy calculations&lt;/strong&gt; (Node.js is single-threaded)
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Node.js is a &lt;strong&gt;powerful&lt;/strong&gt; and &lt;strong&gt;efficient&lt;/strong&gt; runtime for building &lt;strong&gt;scalable, high-performance web applications&lt;/strong&gt;. With its &lt;strong&gt;non-blocking architecture&lt;/strong&gt;, &lt;strong&gt;huge ecosystem&lt;/strong&gt;, and &lt;strong&gt;full-stack JavaScript capabilities&lt;/strong&gt;, it has become a top choice for modern web development.  &lt;/p&gt;

&lt;p&gt;If you're looking to build real-time applications, APIs, or microservices, &lt;strong&gt;Node.js is an excellent choice!&lt;/strong&gt; 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Difference between Javascript Framework Vs Library</title>
      <dc:creator>Prashanth K.S</dc:creator>
      <pubDate>Mon, 31 Mar 2025 06:14:52 +0000</pubDate>
      <link>https://forem.com/iam_prashanth_ks/difference-between-javascript-framework-vs-library-5e32</link>
      <guid>https://forem.com/iam_prashanth_ks/difference-between-javascript-framework-vs-library-5e32</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;JavaScript Framework vs Library: Key Differences&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;JavaScript Framework&lt;/strong&gt; is a complete structure that provides guidelines and predefined code for building applications, dictating how your code should be organized. A &lt;strong&gt;JavaScript Library&lt;/strong&gt;, on the other hand, is a collection of reusable functions and utilities that you can call as needed, giving you more flexibility in structuring your application.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Comparison Table: JavaScript Framework vs Library&lt;/strong&gt;
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;JavaScript Framework&lt;/th&gt;
&lt;th&gt;JavaScript Library&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Definition&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A full-fledged structure that dictates architecture and provides built-in solutions.&lt;/td&gt;
&lt;td&gt;A collection of pre-written code snippets that help with specific tasks.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Control Flow&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The framework controls the flow; developers follow its structure.&lt;/td&gt;
&lt;td&gt;The developer controls the flow; the library is used when needed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Less flexible, as you must adhere to its rules and patterns.&lt;/td&gt;
&lt;td&gt;More flexible, as it can be used anywhere within the project.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Learning Curve&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Steeper learning curve due to rigid structure.&lt;/td&gt;
&lt;td&gt;Easier to learn since it provides independent functions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Angular, React (when used with full architecture), Vue.js, Next.js, Svelte, Ember.js.&lt;/td&gt;
&lt;td&gt;jQuery, Lodash, D3.js, Axios, Chart.js, Moment.js.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Use Case&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Best for building large-scale applications with a defined structure.&lt;/td&gt;
&lt;td&gt;Best for adding functionalities like AJAX calls, animations, or data manipulation.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Dependency&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Often includes built-in solutions for routing, state management, and API handling.&lt;/td&gt;
&lt;td&gt;Requires additional tools for routing, state management, and API handling.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Size &amp;amp; Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Generally larger in size and can be heavier.&lt;/td&gt;
&lt;td&gt;Usually lightweight and focuses on specific tasks.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;List of Apps Built with JavaScript Frameworks &amp;amp; Libraries&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Apps Built Using JavaScript Frameworks:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Angular&lt;/strong&gt; → Gmail, Forbes, Upwork
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React (as a framework)&lt;/strong&gt; → Facebook, Instagram, WhatsApp Web
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vue.js&lt;/strong&gt; → Alibaba, Xiaomi, GitLab
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Next.js&lt;/strong&gt; → TikTok, Hulu, Twitch
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ember.js&lt;/strong&gt; → LinkedIn, Discourse
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Apps Built Using JavaScript Libraries:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;jQuery&lt;/strong&gt; → Twitter, WordPress, LinkedIn
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lodash&lt;/strong&gt; → Various utility functions in web apps
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;D3.js&lt;/strong&gt; → New York Times, Data visualization dashboards
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Axios&lt;/strong&gt; → Used in almost all modern web apps for API calls
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chart.js&lt;/strong&gt; → Google Analytics dashboards
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you need a &lt;strong&gt;structured, opinionated way to build applications&lt;/strong&gt;, use a &lt;strong&gt;framework&lt;/strong&gt;. If you just need &lt;strong&gt;specific functionalities&lt;/strong&gt; like DOM manipulation, animations, or API requests, use a &lt;strong&gt;library&lt;/strong&gt;. 🚀&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What is Body-parser?</title>
      <dc:creator>Prashanth K.S</dc:creator>
      <pubDate>Fri, 28 Mar 2025 07:26:13 +0000</pubDate>
      <link>https://forem.com/iam_prashanth_ks/what-is-body-parser-117m</link>
      <guid>https://forem.com/iam_prashanth_ks/what-is-body-parser-117m</guid>
      <description>&lt;h3&gt;
  
  
  &lt;strong&gt;What is Body-Parser?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Body-parser&lt;/strong&gt; is a middleware in &lt;strong&gt;Node.js&lt;/strong&gt; that helps handle incoming request bodies in Express applications. It parses incoming &lt;strong&gt;JSON, URL-encoded, and raw data&lt;/strong&gt; from the client, making it accessible via &lt;code&gt;req.body&lt;/code&gt;.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Why Do We Need Body-Parser?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;By default, Express does not parse request bodies. If a client sends data in a &lt;strong&gt;POST&lt;/strong&gt; or &lt;strong&gt;PUT&lt;/strong&gt; request, it arrives as a stream, which is hard to handle manually. &lt;strong&gt;Body-parser&lt;/strong&gt; makes it easy to extract and use this data.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;How to Use Body-Parser in Express?&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;1. Install Body-Parser&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;body-parser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;2. Import and Use Body-Parser in Express&lt;/strong&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bodyParser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body-parser&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Middleware to parse JSON data&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bodyParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="c1"&gt;// Middleware to parse URL-encoded data (for form submissions)&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bodyParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlencoded&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;extended&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Access parsed data&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Data received!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Server running on port 3000&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;Types of Body-Parser Middleware&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;bodyParser.json()&lt;/code&gt;&lt;/strong&gt; → Parses incoming JSON data.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;bodyParser.urlencoded({ extended: true })&lt;/code&gt;&lt;/strong&gt; → Parses form data (&lt;code&gt;application/x-www-form-urlencoded&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;bodyParser.raw()&lt;/code&gt;&lt;/strong&gt; → Parses raw body buffer (e.g., &lt;code&gt;application/octet-stream&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;bodyParser.text()&lt;/code&gt;&lt;/strong&gt; → Parses incoming text (&lt;code&gt;text/plain&lt;/code&gt;).
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Is Body-Parser Still Needed?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Since &lt;strong&gt;Express 4.16.0&lt;/strong&gt;, &lt;code&gt;express.json()&lt;/code&gt; and &lt;code&gt;express.urlencoded()&lt;/code&gt; are built-in, so you &lt;strong&gt;don’t need to install body-parser separately&lt;/strong&gt;. Instead, just use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlencoded&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;extended&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Body-parser is an essential middleware for handling incoming request data in Express. While it's still widely used, &lt;strong&gt;modern Express versions include its functionality by default&lt;/strong&gt;. 🚀&lt;/p&gt;

</description>
      <category>express</category>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to install Express.js in VS code in 2025</title>
      <dc:creator>Prashanth K.S</dc:creator>
      <pubDate>Fri, 28 Mar 2025 06:27:08 +0000</pubDate>
      <link>https://forem.com/iam_prashanth_ks/how-to-install-expressjs-in-vs-code-in-2025-14mi</link>
      <guid>https://forem.com/iam_prashanth_ks/how-to-install-expressjs-in-vs-code-in-2025-14mi</guid>
      <description>&lt;p&gt;To install the &lt;strong&gt;Express&lt;/strong&gt; framework on &lt;strong&gt;Visual Studio Code (VS Code)&lt;/strong&gt;, follow these steps:  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;1. Install Node.js&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Express is a &lt;strong&gt;Node.js&lt;/strong&gt; framework, so you need &lt;strong&gt;Node.js&lt;/strong&gt; installed.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download and install &lt;strong&gt;Node.js&lt;/strong&gt; from &lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;nodejs.org&lt;/a&gt; (LTS version recommended).
&lt;/li&gt;
&lt;li&gt;Verify the installation:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  node &lt;span class="nt"&gt;-v&lt;/span&gt;   &lt;span class="c"&gt;# Check Node.js version  &lt;/span&gt;
  npm &lt;span class="nt"&gt;-v&lt;/span&gt;    &lt;span class="c"&gt;# Check npm version  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;2. Open VS Code and Set Up a Project&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;strong&gt;Visual Studio Code&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Create a new folder for your project (e.g., &lt;code&gt;express-app&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;Open the folder in VS Code:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;cd &lt;/span&gt;path/to/express-app
  code &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;3. Initialize a Node.js Project&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Inside VS Code’s terminal, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a &lt;code&gt;package.json&lt;/code&gt; file.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4. Install Express&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;express
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will install &lt;strong&gt;Express&lt;/strong&gt; and save it in &lt;code&gt;node_modules&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;5. Create a Basic Express Server&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In your project folder, create a new file: &lt;code&gt;index.js&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Add this code to set up a simple Express server:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello, Express!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Server is running on http://localhost:3000&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;6. Run the Express Server&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In the terminal, start the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, open &lt;strong&gt;&lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;&lt;/strong&gt; in your browser, and you should see &lt;strong&gt;"Hello, Express!"&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Optional: Use Nodemon for Auto-Restart&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To avoid restarting manually after code changes, install &lt;strong&gt;nodemon&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; nodemon
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, run your server with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nodemon index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Now, you have &lt;strong&gt;Express&lt;/strong&gt; installed and running on &lt;strong&gt;VS Code&lt;/strong&gt;! 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>vscode</category>
      <category>express</category>
    </item>
    <item>
      <title>Hello Guys! I'm new here, Wish me Luck.</title>
      <dc:creator>Prashanth K.S</dc:creator>
      <pubDate>Thu, 27 Mar 2025 10:27:06 +0000</pubDate>
      <link>https://forem.com/iam_prashanth_ks/hello-guys-im-new-here-wish-me-luck-1kp1</link>
      <guid>https://forem.com/iam_prashanth_ks/hello-guys-im-new-here-wish-me-luck-1kp1</guid>
      <description>&lt;p&gt;Hello world, I am Prashanth and UXUI designer and I am currently learning to code.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>discuss</category>
      <category>programming</category>
      <category>uxui</category>
    </item>
  </channel>
</rss>
