<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>TamalWeb by Tamal Chowdhury Blog</title>
        <link>https://tamalweb.com/</link>
        <description>TamalWeb by Tamal Chowdhury Blog</description>
        <lastBuildDate>Wed, 26 Oct 2022 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <copyright>Copyright © 2024 TamalWeb</copyright>
        <item>
            <title><![CDATA[How to Contribute to Open Source for First Timers]]></title>
            <link>https://tamalweb.com/contribute-open-source</link>
            <guid>https://tamalweb.com/contribute-open-source</guid>
            <pubDate>Wed, 26 Oct 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[If you are like me, I had a GitHub account since 2014 and have been dumping all my projects into the profile ever since. But I didn't do anything beyond that.]]></description>
            <content:encoded><![CDATA[<p>If you are like me, I had a GitHub account since 2014 and have been dumping all my projects into the profile ever since. But I didn't do anything beyond that.</p><p>I am a competent engineer, but when it comes to working with open source, I have no clue what that is. I tried many times trying to learn, but failed.</p><p><img loading="lazy" alt="hacktoberfest image" src="/assets/images/hacktoberfestog-7c9e113b89abaa28fc74ef882eb74265.png" width="1200" height="630" class="img_ev3q"></p><p>In October 2022 I participated in the annual Hacktoberfest. This was my first time getting involved in open source. As of writing this article, there are just 7 days left for this year's hackathon. This article will help you participate in open source in general even after the event is over. So let's get started:</p><p>Okay, so a good way to learn something new is to just dive into the topic and get comfortable doing it. </p><p>But where do you start? I watched <a href="https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github" target="_blank" rel="noopener noreferrer">this video from Kent C Dodds on how to contribute to OSS</a>. This course covers the technical parts pretty well. You should definitely check it out to get your Git setup.</p><p>Now here's the golden question: Which repository should you contribute to? Kent again has a blog post about <a href="https://kcd.im/what-oss" target="_blank" rel="noopener noreferrer">which open-source project you should contribute to</a>. The summary of his message is, <strong>you should contribute to the things you use on a daily basis</strong>.</p><p>So I started to make a list of all the projects I use. Mostly the NPM packages I use on a regular basis like express, axios, moment, etc. I also found <a href="https://github.com/MunGell/awesome-for-beginners" target="_blank" rel="noopener noreferrer">this excellent repo with a list of open-source projects</a> you can contribute to. Looking into the repo, I found a lot of familiar names. I went to many of these projects and tried to understand the repo by reading the README, the issues, and pull requests tab. </p><p>I gotta say I am not good at reading so it soon bored me. I found these two projects cdnjs and Brave browser interesting so I looked further. </p><p>Once I found a few interesting projects to work on, I started using the GitHub web interface. The contributions I want to do are many low-hanging fruits. I want to be familiar with the entire Git workflow with low-effort high-reward activities.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-not-to-spam-when-contributing-to-open-source">How Not to Spam when Contributing to Open Source<a href="#how-not-to-spam-when-contributing-to-open-source" class="hash-link" aria-label="Direct link to How Not to Spam when Contributing to Open Source" title="Direct link to How Not to Spam when Contributing to Open Source">​</a></h2><p>When I say low-hanging issues, I don't certainly mean adding a space or a tagline to documentation and calling it a contribution. No, this is spam.</p><p>If you take a look at <a href="https://twitter.com/shitoberfest" target="_blank" rel="noopener noreferrer">shittoberfest twitter</a>, you will find out what are some of the spam contributions people make. When starting open source, you don't wanna send a bunch of spam towards a repository and ban you from the account.</p><p><img loading="lazy" alt="spam contributions from shittoberfest twitter account" src="/assets/images/shittoberfest-cecc44d699d3879a94baa828a330e062.png" width="583" height="578" class="img_ev3q"></p><p>The point is, your contribution should be thoughtful which helps the overall project.</p><p>Below, you will find a few of my low-effort contributions to get an idea of what kind of contributions you should do (click on the link to see the full commit information):</p><p><a href="https://github.com/MunGell/awesome-for-beginners/pull/1132" target="_blank" rel="noopener noreferrer">Removed sButton because it's archived</a></p><p><img loading="lazy" alt="sbutton remove pr" src="/assets/images/sbutton-c3e456dd0bc29194ffccb936efdf2a39.png" width="1372" height="757" class="img_ev3q"></p><p><a href="https://github.com/cdnjs/packages/pull/1366" target="_blank" rel="noopener noreferrer">Add microdiff library to cdnjs</a></p><p><img loading="lazy" alt="add microdiff" src="/assets/images/microdiff-f704f29c3059348ced8a00073cbccf49.png" width="798" height="959" class="img_ev3q"></p><p><a href="https://github.com/beautify-web/js-beautify/pull/2107" target="_blank" rel="noopener noreferrer">Update documentation for JS Beautify</a></p><p><img loading="lazy" alt="update documentation" src="/assets/images/webbrowser-6c7c786001e35c1873b7b1633d3bf231.png" width="886" height="925" class="img_ev3q"></p><p><a href="https://github.com/theritikchoure/carrierjs/pull/6" target="_blank" rel="noopener noreferrer">Adds facebook open graph tags to 2 files</a></p><p><img loading="lazy" alt="adds fb open graph tags" src="/assets/images/fbog-2bc23ff8305ddf24999da972efe6c16f.png" width="870" height="845" class="img_ev3q"></p><p>Now let me show you how you can contribute to open source using the GitHub web interface,</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-contribute-with-the-github-web-interface">How to Contribute with the GitHub Web Interface<a href="#how-to-contribute-with-the-github-web-interface" class="hash-link" aria-label="Direct link to How to Contribute with the GitHub Web Interface" title="Direct link to How to Contribute with the GitHub Web Interface">​</a></h2><p>GitHub's web interface is excellent for contributing to open source when you are just getting started. You can fork projects, make pull requests, comment, upload files, and many more. If you are just starting out like me, you should definitely give the web interface a shot. The <a href="https://github.com/cdnjs/packages/blob/master/CONTRIBUTING.md#make-changes-to-your-fork" target="_blank" rel="noopener noreferrer">contributing guideline from cdnjs</a> even encourages people to contribute a package using the web interface when making a single commit.</p><p>While reading the <a href="https://github.com/MunGell/awesome-for-beginners" target="_blank" rel="noopener noreferrer">list of cool open-source projects</a>,</p><p><img loading="lazy" alt="list of awesome projects to contribute" src="/assets/images/awesomepr-9653f84ada9d520b1bf542d82257aa68.png" width="888" height="549" class="img_ev3q"></p><p>I <a href="https://github.com/sButtons/sbuttons" target="_blank" rel="noopener noreferrer">found a project listed</a> under the CSS section. So I went there and saw this project is not maintained anymore.</p><p><img loading="lazy" alt="sbutton archived now" src="/assets/images/sbuttonarchived-6831bbfaeab571dbc94268ed2583e839.png" width="877" height="274" class="img_ev3q"></p><p>Removing this project from the list would be a great start to OSS. If I remove it, other devs won't have to spend their time exploring a project which is already archived.</p><p>So I removed the item from the readme file and created a new pull request.</p><p>Unfortunately, there was a red <strong>Invalid</strong> mark next to it. </p><p><img loading="lazy" alt="invalid pr" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfEAAABLCAMAAABXyk7oAAADAFBMVEX////2+PrY3uT0FkYkKS/Q194kKjb///r///T//NL5///c/v8rKS/x//8kLVgkKzwkLE4yKy9mmtWISC9hMC9zvv6Kxfj//+zptoz/3a1VLC/q////4qGX2f4kLEN7tur//diZcYe8dDni/v8kLWWp7v8tbrdqgbP2xZdkcYD97djLmXY8Ki/PIi5eiL5tcny16f7//+XwuozH9/+N1P9nbHS67///9+CtgXG5im+t5v+SzPhCjNe/vsQlUprEkXFvNS90quFtodhhlc/1UbDVoH3opWX3HkaXVjL0///90aPi+f+l3f/+6sv//L//6r/94bh6jLYtQlvY9f///MlrkcGJaookR4okPH76QEbQ/P9weKx3gIbdq4JYY2s3MjJ+PC9GMi+/9////t4kWKCfeXnysG31MVvbmFnPiErN7f+Dzv6y2/j/8rUqZa3w0anmvp58bZk8WXbqp2WBvvJVoOP7p7lQcIB8dneSdmw1TWhRVlOkYjN9QjCd3v+fy/D54uSHsdz/9tf/9Mn/2pdle5eFjZZvr4JcZpPKpY79vnrwu3plU0dOLC+AqtQ/hdH/67L+6an0JopDZISpfn/0H36ujn0nQW0kNFB2ZU9SSD5jrvJRmN74mNz41to6fsaKi4WJf3x4b2ufemfCgEtjSjjp5utiq+qTvOb//ONie6tzhqP+z4tqd4vCl4QkMXBCOjbz0seFn76tlor+sYL+lW4sPFA+R0xxWkPSLzoafzfG3PPj78fnkJZTcZLaso7ksYT5YoGQc3qQZUutajdZPzP97et3oM1His2YoslffrO8v5v5eZXkgon2G1n5tfX/+Ou83cL03rmffJu2pJCei33ZklL+9/vx//C4zN+twdW1t8CItrjoybCguKZ/cVq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uQmCC" width="497" height="75" class="img_ev3q"></p><p>GitHub has these actions setup by the project maintainers. </p><p>In my case, the automated script checked and saw I did not edit the correct file.</p><p><img loading="lazy" alt="invalide explanation" src="/assets/images/invalidexplanation-3b576a12dbc5b0eec12c61658e46b46d.png" width="550" height="240" class="img_ev3q"></p><p>Going back to the <code>contributing.md</code> file, I learned that I must update the <code>data.json</code> file instead of the README file. The readme will be auto-generated from the json. </p><p><img loading="lazy" alt="contributing guide" src="/assets/images/contributingguide-b4734baa2a4fa5d3fa022458f0b89194.png" width="1110" height="525" class="img_ev3q"></p><p><strong>Lesson learned. Read the contribution guide.</strong></p><p>I deleted this pull request and made a new one following the process.</p><p>The overall process of making a pull request looks like this,</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p>Please don't copy paste my commits, just use it as a guide to contributing in general.</p></div></div><p>Fork the repo you want to contribute to.</p><p><img loading="lazy" alt="fork the repo" src="/assets/images/fork-bcd8865e971657861e4926c49b1eea11.png" width="1140" height="462" class="img_ev3q"></p><p>Go to your version of that project.</p><p><img loading="lazy" alt="readme" src="/assets/images/yourversion-e0b9cf293a8bdf7038d680a403f439b3.png" width="1118" height="773" class="img_ev3q"></p><p>Make changes to the files by clicking the pencil button, or add new file.</p><p>In this case, I changed the <code>data.json</code> file to remove the sButton project from the list.</p><p>After making the changes, commit them by filling out the form,</p><ul><li>Write a compelling title for your PR. </li><li>Add a detailed description explaining <strong>what you did</strong> and <strong>why you did it</strong>. </li><li>Create a new branch name to identify your change like: <code>pr/your-change</code>.</li></ul><p><img loading="lazy" alt="commit changes" src="/assets/images/commitchanges-b13337d1feb57dfd2e8ed32b172f108f.png" width="1021" height="787" class="img_ev3q"></p><p>Commit the new change by clicking the green <strong>Propose Changes</strong> button.</p><p>After you click this button, you might see a green button to create a pull request, but don't. Clicking this button will just create a pull request into your own copy and not to the project you want to commit to.</p><p>Now go back to the original project by clicking the small link under your project url:</p><p><img loading="lazy" alt="go to original project" src="/assets/images/mainproject-1e28ce834a0c3b1b7b581689662c00db.png" width="924" height="353" class="img_ev3q"></p><p>Now over here, you will see a new button for you to <strong>Compare &amp; Pull Request</strong>. </p><p><img loading="lazy" alt="compare and pull request" src="/assets/images/createpullrequest-efa38bddab53623c6e18bc68020cf114.png" width="817" height="268" class="img_ev3q"></p><p>Click on it and you will be presented with another window to commit your changes. This time, it will be auto filled with your commit info. If you wish, you can edit your commit message and description.</p><p><img loading="lazy" alt="open pull request" src="/assets/images/openpull-433d712148b0f47e63e2c5a4186098e9.png" width="808" height="623" class="img_ev3q"></p><p>For my commit, I described the change I made and submit the request.</p><p>Now I can go to the pull requests tab and see my PR.</p><p><img loading="lazy" alt="my pull request" src="/assets/images/mypullrequest-9c4730f48c2a7de6c06ea5fc0d76848f.png" width="1134" height="542" class="img_ev3q"></p><p>This time, my PR was not marked as invalid and it was waiting for review from the maintainer.</p><p>Within a day or two, I received an email from GitHub that my PR was accepted and merged into the code.</p><p><img loading="lazy" alt="accepted pr" src="/assets/images/accepted-ab8cbd58c035092721639d245dff75c1.png" width="933" height="520" class="img_ev3q"></p><p>And just like that, I made my first contribution to an open-source project. It was a minor edit, but I got to learn the entire GitHub work flow.</p><p>In the following days, I started exploring cdnjs and trying to contribute to some more code,</p><hr><p>I have some more sections written for this tutorial. </p><p><img loading="lazy" alt="more sections" src="/assets/images/moresections-2b9a1f4ed63305d36e60932ce9bf0f9c.png" width="808" height="475" class="img_ev3q"></p><p>For time shortage, I was only able to publish this first section. Be sure to check back later or <a href="https://twitter.com/tamalchow" target="_blank" rel="noopener noreferrer">follow me on Twitter</a> to stay updated on the next parts. You can look at my contributions in open source <a href="https://github.com/tamalchowdhury" target="_blank" rel="noopener noreferrer">on my Github profile</a>.</p><p>To be continued...</p>]]></content:encoded>
            <category>open source</category>
            <category>javascript</category>
        </item>
        <item>
            <title><![CDATA[How I developed TamalWeb.com blog, and do its SEO]]></title>
            <link>https://tamalweb.com/develop-tamalweb</link>
            <guid>https://tamalweb.com/develop-tamalweb</guid>
            <pubDate>Mon, 10 Oct 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[This is not a 'how to' post but an answer to a frequently asked question. My blog was originally made with WordPress. I came across Docusaurus, an open-source static site generator for documentation sites. I thought of using that for my blog because my tech blog also works like documentation.]]></description>
            <content:encoded><![CDATA[<p>This is not a 'how to' post but an answer to a frequently asked question. My blog was originally made with WordPress. I came across <a href="https://docusaurus.io/docs" target="_blank" rel="noopener noreferrer">Docusaurus</a>, an open-source static site generator for documentation sites. I thought of using that for my blog because my tech blog also works like documentation.</p><p>The best part is, all the pages are statically generated and they load up instantly with a click of a button. Docusaurus is built on top of React and JavaScript, so it's yet another reason to use it.</p><p>I set up a demo site following the instructions and one by one, copied all the posts from my WordPress blog to the new docusaurus site.</p><p>I could have saved this time by automating this process. <a href="https://twitter.com/johnny_reilly" target="_blank" rel="noopener noreferrer">John Reilly</a> has a guide on <a href="https://blog.johnnyreilly.com/definitive-guide-to-migrating-from-blogger-to-docusaurus" target="_blank" rel="noopener noreferrer">how to automate this process with a TypeScript script</a>. His method is to export your blog in XML format (WordPress also does that) and then import them to Docusaurus with a script written in TypeScript.</p><p>When creating a docusaurus site, your articles will be stored in a directory like this:</p><p><img loading="lazy" alt="directory" src="/assets/images/1-d2aa4bee714a4f8d71220cded9a1e246.png" width="247" height="185" class="img_ev3q"></p><p>I put them by year. I create a directory per blog post because I wanna have a dedicated <code>images</code> folder to call for images.</p><p>All the blog posts are written in a <a href="https://mdxjs.com/" target="_blank" rel="noopener noreferrer">unique flavor of Markdown, MDX</a>. With MDX it is possible to import additional React components to make an interactive blog experience.</p><p>For the blog post meta, there is this special <strong>front-matter</strong> syntax you can use. The front matter handles the title, slug, tags, and author information.</p><div class="language-mdx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">blog/2022/3-8-mastering-json-reactjs/index.md</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-mdx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">---</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">title: Mastering JSON in ReactJS</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">slug: json-reactjs</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">authors: tamalweb</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">tags: [reactjs]</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">image: ./images/feature.png</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">---</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">Rest of the article goes here...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Since I am the only author of this blog, I set my info into the <code>authors.yml</code> file. Whenever I set this author username, it will call what's in the yaml file.</p><div class="language-yml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">blog/autors.yml</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yml codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token key atrule">tamalweb</span><span class="token punctuation" style="color:rgb(212, 212, 212)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token key atrule">name</span><span class="token punctuation" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> Tamal Chowdhury</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token key atrule">title</span><span class="token punctuation" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> Software Engineer</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token key atrule">url</span><span class="token punctuation" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> https</span><span class="token punctuation" style="color:rgb(212, 212, 212)">:</span><span class="token plain">//tamalchowdhury.com</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token key atrule">image_url</span><span class="token punctuation" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> /img/tamalweb.jpg</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Docusaurus is open source, and so is the code of my blog. You can find the <a href="https://github.com/tamalchowdhury/tamalwebsite" target="_blank" rel="noopener noreferrer">entire code in this repository</a>.</p><p>I have hosted this blog on <a href="https://www.youtube.com/watch?v=aJVKKbisM0w" target="_blank" rel="noopener noreferrer">Netlify</a>. Every time I make a new update to the <code>master</code> branch, Netlify will rebuild the site and host it on their awesome server for free.</p><p>Finally, when it comes to SEO, I haven't done anything out of the box. I make my blog articles' title SEO friendly, and the slug human friendly. Every time I write a new post, I try to tag them and link to and from other relevant posts. There are some long-form blog articles I wrote following the <a href="https://www.youtube.com/watch?v=9jLo89V_q3g" target="_blank" rel="noopener noreferrer">Project 24 SEO method</a>.</p><p>I think that's about everything about my blog. If you have any additional questions, then send me a DM or <a href="https://twitter.com/tamalchow" target="_blank" rel="noopener noreferrer">tweet me @tamalchow</a> and I will update this post with the answers.</p>]]></content:encoded>
            <category>docusaurus</category>
            <category>reactjs</category>
        </item>
        <item>
            <title><![CDATA[How to Setup a Local Development Environment for React & Node.js]]></title>
            <link>https://tamalweb.com/setup-local-dev-environment</link>
            <guid>https://tamalweb.com/setup-local-dev-environment</guid>
            <pubDate>Mon, 15 Aug 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[A local development environment is where all the development happens, after which devs push it to a live production server. In this article, you will set up a local web development environment on your computer for building modern web apps in Node.js and React. This setup is also suitable for other frontend frameworks like Vue, Angular, and Svelte.]]></description>
            <content:encoded><![CDATA[<p>A local development environment is where all the development happens, after which devs push it to a live production server. In this article, you will set up a local web development environment on your computer for building modern web apps in Node.js and React. This setup is also suitable for other frontend frameworks like Vue, Angular, and Svelte.</p><p><img loading="lazy" alt="local web development" src="/assets/images/featured-4d4543a6d8ecdd01f2fb9960ae015002.jpg" width="4288" height="2848" class="img_ev3q"></p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="prerequisites">Prerequisites<a href="#prerequisites" class="hash-link" aria-label="Direct link to Prerequisites" title="Direct link to Prerequisites">​</a></h3><p>To follow this tutorial, you will need the following:</p><ul><li>A modern laptop or desktop computer with internet access.</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-1--install-nodejs-on-your-computer">Step 1 – Install Node.js on Your Computer<a href="#step-1--install-nodejs-on-your-computer" class="hash-link" aria-label="Direct link to Step 1 – Install Node.js on Your Computer" title="Direct link to Step 1 – Install Node.js on Your Computer">​</a></h2><p>In this step, you will install Node.js on your computer. Node.js is a JavaScript runtime engine. All the modern JavaScript bundlers like Webpack and Gulp make use of Node.js to be able to do their bundling work. Even if you are not working as a backend developer, Node.js is required to work with frontend frameworks like React and Vue.</p><p>Go to the <a href="https://nodejs.org/" target="_blank" rel="noopener noreferrer">official Node.js website</a> and download the latest <strong>LTS</strong> version of Node. Node has two versions, LTS, and current. LTS stands for long-term support and is recommended for development work. <a href="/which-nodejs-version">Read more about the reason why you should pick the Node LTS version here</a>.</p><p>After downloading the Node LTS, open the installer and follow the installer steps to install Node into your system.</p><p><img loading="lazy" alt="node setup" src="/assets/images/node-setup-30999674d330db48ea505fab2e4c244f.png" width="632" height="498" class="img_ev3q"></p><p>To verify your node installation, open your terminal or PowerShell in Windows and type the following command:</p><div class="language-sh codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-sh codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">node -v</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You will see an output like this:</p><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">v16.14.0</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Now that you installed Node.js, it's time to install Git Bash.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-2--install-git-bash-for-windows-computers">Step 2 – Install Git Bash for Windows Computers<a href="#step-2--install-git-bash-for-windows-computers" class="hash-link" aria-label="Direct link to Step 2 – Install Git Bash for Windows Computers" title="Direct link to Step 2 – Install Git Bash for Windows Computers">​</a></h2><p>In this step, you will install Git Bash to be able to run the Linux commands on your computer. If you are using Linux or Mac, then you can skip this step, because those systems already come with a built-in Bash terminal you can use.</p><p>Go to the <a href="https://git-scm.com/download/win" target="_blank" rel="noopener noreferrer">official Git Bash website</a> and download the installer. Open the installer and follow the installer wizard to complete the installation.</p><p><img loading="lazy" alt="git setup" src="/assets/images/git-setup-2354e4fb0aa4c501c184985bd29e46c9.png" width="598" height="494" class="img_ev3q"></p><p>This installs both Git and Bash sell environments into your computer. You will use them for the day-to-day development workflows.</p><p>Now that you have installed both Git and Bash, in the next step, you will install VS Code editor.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-3--install-vs-code-editor">Step 3 – Install VS Code Editor<a href="#step-3--install-vs-code-editor" class="hash-link" aria-label="Direct link to Step 3 – Install VS Code Editor" title="Direct link to Step 3 – Install VS Code Editor">​</a></h2><p>In this step, you will install and set up VS Code on your computer. Although you can develop web apps in any editor in the world, VS Code is truly the de-facto standard for web development nowadays. By installing VS Code, you will get to use all the top extensions that will help you supercharge your development.</p><p>Go to the <a href="https://code.visualstudio.com/" target="_blank" rel="noopener noreferrer">official website for VS Code</a> and download the installer for your operating system.</p><p>Open the installer and follow the installation process to finish setting it up.</p><p>Open VS Code,</p><p><img loading="lazy" alt="vs code" src="/assets/images/vs-code-6df617f6353d2938ca21f266e72eec83.png" width="982" height="807" class="img_ev3q"></p><p>Next up, you will install some handy extensions.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-4--install-recommended-vs-code-extensions">Step 4 – Install Recommended VS Code extensions<a href="#step-4--install-recommended-vs-code-extensions" class="hash-link" aria-label="Direct link to Step 4 – Install Recommended VS Code extensions" title="Direct link to Step 4 – Install Recommended VS Code extensions">​</a></h2><p>In this step, you will install some additional extensions for VS Code. The editor already comes with many tools built in, and these extra extensions will speed up your development.</p><p>Open the extensions marketplace by clicking on the extension's icon. Search for the extension, click on it and install by clicking on the <strong>Install</strong> button.</p><p><img loading="lazy" alt="vs code extensions" src="/assets/images/install-ext-2d1713444fe3350426a7a7a9b5c83cc6.png" width="1211" height="799" class="img_ev3q"></p><p>Install these extensions for VS Code:</p><ul><li><strong><a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode" target="_blank" rel="noopener noreferrer">Prettier</a></strong>: is a code formatter. It will automatically format your code by adding and removing spaces. Check out my video on YouTube on <a href="https://www.youtube.com/watch?v=dZU2HsrlGZ4&amp;t=1s" target="_blank" rel="noopener noreferrer">how to configure prettier with VS Code</a>.</li><li><strong><a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer" target="_blank" rel="noopener noreferrer">Live Server</a></strong>: will create a live server for when you are working on a classical web development project. Please check out my video on <a href="https://www.youtube.com/watch?v=i6EMMG6Hmjs" target="_blank" rel="noopener noreferrer">how to use the live-server extension to preview your projects</a>.</li><li><strong><a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag" target="_blank" rel="noopener noreferrer">Auto Rename Tag</a></strong>: will auto rename HTML tags for you.</li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="conclusion">Conclusion<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion">​</a></h3><p>You have set up your local web development environment. Your next step would be to create a sample website and host it on the internet.</p>]]></content:encoded>
            <category>nodejs</category>
            <category>reactjs</category>
        </item>
        <item>
            <title><![CDATA[Setting up a Digital Ocean Droplet for Pentesting]]></title>
            <link>https://tamalweb.com/digital-ocean-pentesting</link>
            <guid>https://tamalweb.com/digital-ocean-pentesting</guid>
            <pubDate>Thu, 10 Mar 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[I am learning pen testing and ethical hacking as a hobby. When doing pentesting, it's common to setup a local Virtual Machine (VM) using Virtual Box to setup the attack boxes. However, one issue I face regurlary is how slow each of the tool installation and scaning takes. Since local VMs rely on my internet speed, often it takes a lot of waiting time for scanning outside servers.]]></description>
            <content:encoded><![CDATA[<p>I am learning pen testing and ethical hacking as a hobby. When doing pentesting, it's common to setup a local Virtual Machine (VM) using Virtual Box to setup the attack boxes. However, one issue I face regurlary is how slow each of the tool installation and scaning takes. Since local VMs rely on my internet speed, often it takes a lot of waiting time for scanning outside servers.</p><p><img loading="lazy" alt="digital ocean pentesting" src="/assets/images/featured-9f396d2b0f9f3ddb9f70529693892f39.png" width="1200" height="630" class="img_ev3q"></p><p>Then I realized I can use a VM from a VPS provider such as Digital Ocean and use it for external pentesting. By doing so, I can use a faster CPU, RAM, and of course, fast internet speeds. Working with a commercial VM will help you speed up your processes when connecting to public servers like <a href="https://www.hackthebox.com/" target="_blank" rel="noopener noreferrer">HackTheBox</a> or <a href="https://pentesterlab.com/" target="_blank" rel="noopener noreferrer">PentesterLab</a>.</p><p>In this article, I will walk you through setting up a pen-testing attacker machine with Digital Ocean.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="setting-up-a-digital-ocean-droplet-vm">Setting up a Digital Ocean Droplet (VM)<a href="#setting-up-a-digital-ocean-droplet-vm" class="hash-link" aria-label="Direct link to Setting up a Digital Ocean Droplet (VM)" title="Direct link to Setting up a Digital Ocean Droplet (VM)">​</a></h2><p>To use the droplets, you have to sign up for a Digital Ocean (DO) account. DO offers <a href="https://m.do.co/c/c19340f2e4a7" target="_blank" rel="noopener noreferrer">free credits from $100-200</a> that you can use for the first two months (this is my referral link). I say this is a great way to try out the product without paying the full price.</p><p>After signing up, create a new project.</p><p>I am naming my project <strong>pentesting-1</strong></p><p><img loading="lazy" src="/assets/images/2-1044db1812fb46d83a2016b0b1961387.png" width="870" height="806" class="img_ev3q"></p><p>After creating the project it's time to create a droplet. In Digital Ocean, a VM is called a droplet.</p><p><img loading="lazy" src="/assets/images/3-335257f867fe05e29be81e334c7d05d6.png" width="1651" height="887" class="img_ev3q"></p><p>On the droplet creation page, you can choose from a range of Linux distributions. If you are experienced, you can install a custom image like Kali, or use the barebones Debian. For this article, I will stick to the basics with Ubuntu. I am choosing Ubuntu because it's a well-known Linux distro with lots of tutorials on the internet.</p><p><img loading="lazy" src="/assets/images/4-504cebcb09b841f2a6e17aa81f9cd374.png" width="1035" height="531" class="img_ev3q"></p><p>With Ubuntu, we have to manually install all the pen-testing tools as we go. This is a great exercise in working with packages in Linux.</p><p>Pick a plan for your droplet. The $5/mo basic droplet is enough for beginners. When you gain more experience and need more horsepower, you can create bigger droplets.</p><p><img loading="lazy" src="/assets/images/5-658c65a1c43f9b120699229f91037b5d.png" width="1044" height="677" class="img_ev3q"></p><p>Choose the closest data center location for your droplet. Since I live in Bangladesh, I am picking the Bangalore data center. By picking a close server, my data will take less time to travel. This will result in a faster user experience.</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAwUAAAHXCAMAAADa0gZGAAAC+lBMVEX////1+f/f39//hmMdgbz1kW0Aaf9EREQVzXL0sWBnZ2f/8Ov/kXH/rZYehL7/49v/noL/iGX/+ffn///t7e3/yrr//8/P//+YaGf/mn1ERJFnaIBLRESZ0P/otH9mgLZnms7//uhERUtur+f/mXz1wIHPkUT41Kb3qItxaGeBaGdERW5uRETz///++fHz8vP0tWj/5rfOmmmAtOf///N/5LL/6LH/t6Lg/P+x6P/r+/NA1o4i0HqCutoqiMBJmsqAg5XrhWv//vq25//6///2n4HosG5naG36wKuwbkVFba//0Jj4sZjt8PWSREQfh8DO8/8ogbdnbHPt/f/39/fw7+6dn53/oodnZ5jesv+fgv+beGfo6OcyjMKQzP9TSUREkc9EWY3JsZi5oIV+y/9dSURznc3/+MZmdJS+8f+MwfO3z+dSnsvKyMX2yJHW/f+i3/+t5P6tfmfl7fqXvOL/9M3/77z/1pz/zJPA+f/J6f7///b99fL28exGX57BjWPv9vv//uGxwslne61ueIbao2m2gmdESVdLa/8Zaf96qNixlXaazPF4lbeUV0Xb8f8FgP/86Mrs2LmFnbhmd6D0zppkUkj08f/14P/K3O///tWTbkx3ufKkwOT/8dfKwLOki3h6a2fUl1K6n//05NpOsf//+ejeq3mNemucssyOpsIphLn/4arht4J5UEW+5/9AkP+22/D/8d2futj92c5HhsPavJ3twY1JXIFbaXrVnGZ4Zlq60/9env9wb//Z5vToyK53iJ9sgZWJbmM3bf+Ostxoj8NIebxRgqeIlJ9ERXqUiHJETWi8eUSJRUQFdP/uhmtERWGs3P+Hnv+CdP/96OHKp4WBdGw3j8Pzzv9Rmd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OgbuTil+31JVCnQO6WX3Z1S/wh3p1Ra0ApUPemhge5yqrgVBUEZpMB9a7bK8hRUvzXzFFj34s6JhNlvzSrlVrmvx4am+J4FVW/NfCPct2ZJ21Mg0ZQKopA7y7MgMCMURK/IfLO6vSgV1BLrgt+HAlMVDA7Ig14J1xQKQkKBqQrUdyK6y2ryX1MoCAkFpirIloflYkBO/msLBSGhwFQFfxUKQkMBClCAAhSgAAUoQAEKUIACFKAABShAAQpQgAIUoAAFKEABClCAAhSgAAUoQAEKUIACFKAABShAAQpQgAIUoAAFKEABClCAAhSgAAUoQAEKUIACFKAABShAAQr+baNap2AFrZNFPAt4FhAKUEAo+NauHeI0EAUBGH67YkWvQEJwhDrOgV1DUsUxOAEkCBAkeEKC3AOsxPcIKDxHYCWi2z7VfX3z/TcY8c2YoUAUUCAKKBAFFIgCCkQBBaKAAlFAgSigQBRQIAooEAUUiAIKRAEFooACUUCBKKBAFFCgohScry5SRtUq+H3sPpqDUbCvk1fwehVbwYSAgqJaQMHlehVawYSAgrI6voLr9dldZAUTAgoK6/gKXj6fbgIreHvont8pKKs2LVBkBc3P1/0tBWVFwQJRUFgUZERB5VGQEQWVR0FGFFQeBRlRUHkUZERB5VGQEQWVR0FGFFSez+ooUUABBRRQQAEFFFBAAQUUUEABBRRQQAEFFFBAAQUUUEABBRRQQAEFFFBAAQUUUEABBRRQQAEFFFBAAQUUUDDfd4rSbgXbJkoUUEABBfNt+hSjfpN2NYxNjMYhaa6+jcFgbs5xG4PBNGfSnh3ZRmj25o1DF6EBAkmSJEmSJEmSJEmSJEmSJEmSJEmSJEmSJEnS//4AJ219ZG0K1boAAAAASUVORK5CYII=" width="773" height="471" class="img_ev3q"></p><p>For authentication, it is recommended to set up an SSH key. But to keep this post simple, I will just use a password to login into the VM. Make sure to store this password somewhere safe. I saved it in my LastPass account.</p><p><img loading="lazy" src="/assets/images/7-92b3d219ac41f9bd1aea6eb908d60243.png" width="1080" height="625" class="img_ev3q"></p><p>I don't need to pick any additional options.</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfwAAADVCAMAAACFWLJrAAAC+lBMVEX///8Aaf/f399ERETs7OxnZ2f/6LNur+duRETnr27c3Nzn//+x6P9ERG5vaGfOmmj//+f/6P//zZX///P//8/P//9+Z2dnaHBEREtKRETx8fHf/v+c5//E9/9naIKXaGeF0P9ESVfW///otv+wbkXPkUT/9f9ERJKUxfv//vrw8P/Yx//u/f+SzP+myP9nZ5PntYD6///z/v+2f2dFba/n+/+SRETN9f/v2f9Xtv//++h1qt3Kx8jf8v8AnP8aa/9odJq25/9Saf+a0PyAtudneqxTRkREkc9pk8VEVZZfbf/z8fNnf7b3//9manq88P9y2f8Ag/9eSkSo6v+r4f/7zv+1m3x6XU0ee/9pms//8sBAav+Eaf+Hve7x2bj/1p3Bj2eHaGf//u3/8d766M0Ac/+Sx/L1z5nerHnV/P/2+P+3qf9Fj/91a//K6f3//tYAff///+HWonCY1//Gm///9NCarcdJXH6VeWhKa/+caf/X7f719vfK4++txuJwj7N+k61ESWZ/R0S74/+jnv/avJ3KtJu3hWilgf92dGqsfWfj1f8Kvv/w695Hh8SZlprzwIhER36lh3eAb2SVVUW7eES9y/+q0u7m5uZ6n73/5K2dnZ1nZ5lrdYe8o4VvdnZLVlzChE9eVUprT0al1//erf+61uTr4sqKqcL/7brMwrr93qpEY6Vzh41MVmvTllXH///o3//63f+FgP+t2f7e7u5votdRmtX/+cqQqrfovIzvu3mhcWe61//Kyv/Ppf+Lcv+GqNH+5b5niLxbgrXfybQamP8sav+32vJgpOG6x8pvgqW1qJdbc4enj4KTjG+jvf+/uf+siv9uiv+Shv8+ev+Hv/yau9qmvNHk07nqx5qGem1zxv9Grf+7lP9KaJKSlJHJqo/MpYF4uvBKks/hpV5dXV19a1mnYUSNyf/Yvf9zrf9mo//+8vF9sOKfa0pFyv/Ov/8Srf82nv8AlP9KebiQnaOifmjEz96TakpXpf9Sef9eeJxKSkp+o37NAAAWlklEQVR42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tuDLZVxSEr6UhC8l4UtJ+FISfgxLwo9hSfgxLAk/hiXhf2u/DmgAAGEgBhLsYQkhk4sPemehybIPEz9M/DDxw8QPEz9M/DDxw8QPEz9M/DDxw8QPEz9M/DDxw8QPEz9M/DDxw8QPEz9M/DDxw8QPEz9szqLqbvW77mx+J36Ys4+HD1MP8dPEDxM/TPww8cPEDxM/TPww8cPEDxM/TPww8cPEL3iYkYGwerN8ngAAAABJRU5ErkJggg==" width="508" height="213" class="img_ev3q"></p><p>I finalized creating the droplet by clicking on the big green button.</p><p><img loading="lazy" src="/assets/images/9-963c28a0da059496ce035a1536d1361c.png" width="992" height="788" class="img_ev3q"></p><p>Now there is a droplet in the dashboard. This will also display the public IP address which I will need to log in in the next section.</p><p><img loading="lazy" src="/assets/images/10-0d11edc4bbd9740c0b30bf2a8c87f814.png" width="943" height="397" class="img_ev3q"></p><p>Next, I need to log in to the droplet.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="logging-into-digital-ocean-using-ssh">Logging into Digital Ocean using SSH<a href="#logging-into-digital-ocean-using-ssh" class="hash-link" aria-label="Direct link to Logging into Digital Ocean using SSH" title="Direct link to Logging into Digital Ocean using SSH">​</a></h2><p>To log in to the droplet I created, I will open up my terminal. I am using VS Code, so I am going to use the Bash terminal. If you want to know <a href="https://www.youtube.com/watch?v=nLue1WsetbE" target="_blank" rel="noopener noreferrer">how to set up Git Bash in your Windows environment, check out my YouTube video</a>.</p><p><img loading="lazy" src="/assets/images/11-7e04d0f7b2ea9b8339b185f8573aa186.png" width="1208" height="493" class="img_ev3q"></p><p>Enter the ssh login command,</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">Terminal</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token function" style="color:rgb(220, 220, 170)">ssh</span><span class="token plain"> root@</span><span class="token operator" style="color:rgb(212, 212, 212)">&lt;</span><span class="token plain">IP ADDRESS</span><span class="token operator" style="color:rgb(212, 212, 212)">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Since I am not using an SSH key, it will warn me if I trust this remote machine.</p><p>I will type in <code>yes</code> and press enter to confirm I understand and trust this host.</p><p>Next, it will ask me for the password. This is the password I set in the droplet creation section (not my Digital Ocean account password).</p><p>After entering the password, I will be greeted with the Ubuntu welcome message.</p><p><img loading="lazy" src="/assets/images/12-06d9cab7844b3b2e0f3e8a09d2bdbd7d.png" width="901" height="516" class="img_ev3q"></p><p>Now I can use this virtual machine as if it is installed on my own computer.</p><p>The first thing I would wanna do when starting a brand new VM, is to upgrade the packages.</p><p>Enter <code>apt upgrade</code> and <code>apt update</code> one after another to update all the packages.</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">Terminal</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token function" style="color:rgb(220, 220, 170)">apt</span><span class="token plain"> upgrade</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token function" style="color:rgb(220, 220, 170)">apt</span><span class="token plain"> update</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>I can also log in to the droplet using the web-based interface.</p><p>Press the three dots next to the droplet.&nbsp;
Click <strong>Access Console</strong>.</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWEAAAEzCAMAAADXZ0IZAAAC9FBMVEX////9/f36+vr/AAD8/Pz39/ff39/5+fn09PT4+Pjz8/NnZ2fu7u7X19fw8PD29va0tLTo6OjNzc3q8/95eXnQ0NDr6+toaGgAaf+KiopwcHBycnLt7O2bm5ve3t52d3b6/P9ra2vT09PFxcXl8P8TdP/y8vL8/v+NjY2kpKSWlpZ7e3tqamoPcv+6urrs9P8Kb//i4uJXnP8Cav/I3/+9vb10dHTu9f/q6urk5OSfn59/f39+fn6XZ2dEkf8Ea/+EhITw9//Z2NkaeP/l5eXa2tpubm5tbGvY6P/Hx8fQ5P/O4v/G3f+tz//W1tbKysrz+P/c6//U5v+hyP/JycmzsrOoqKjo///1+f8yh/8kfv///85nf7arq6uYmJhlY2Tn8f/f7f+MvP9eoP8Hbf/c3Nxomc2xsbGGhoZnaHhtbW3S5f84iv++2f+ozP/AwMCPj4+JiIi51v+Atf9kpP/j4+Surq6SkpLotH+t3/8gfP/n5+f/6LbZ6v9coP9Smf///ed/tOfPz8+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w40mFenPVJr6VA2JEOY0rn7aUjHS4pwuSwFHJYMcLksBRyWDHC5LAUclgxwuSwFHK4HwkvrFu0AP8jh51B+FT5bSLcr4S3sg1EmAjbELsJX/yaZJlLFwCgPXeGZfecHY/fnjwA0HE00woAXcjVWMowG4RlAEeuJ9m3y2NByGr2Otebcg/svnqDCHNs2UjPias32AuA9dvYnhPnzrNDRbb36/Bj8bPO//1Vlp+7zFyGgDtP37mbu4F/DpFwOPP5kvve7+xlIswJXzM8TQHsZwdB54xEubddmZ/IjvtsVglxGdLcDADds6wOL7qFVaKQeUVVQqjDazel4Pix3Tv5jWH7XriPX3cc3f0FKW5FWUXC4rIu1rMOrNGpYx0+XJcfTISthPk/PYc53WvPDtftPdJ5CAqZ1o53czGLOWHLsvYn21nm05zxMuGHm5qamohwH8Kdf9FdWQCP2e2t2ZvtPxZdPLb7AFZezGZO2LoMuj/gWZe6IBE+0nnlzXQi/P8qgWdY/ij++Pjao9698N8qwbP+aaZVIoyrXlKVsBC2nnTQ/jRrgE5mb1oJi8vu3QH+xXOAQVbC7v1Nh4iwlbB5WztogGKb+VenubE8D3tPP7okLOsosJ63F3O9eNkosNR4C+G7v5p6iLCFsPnEAcC/QbQ6r5S5GA+2bH6BsKzjI1bh75dv6R7jcpHwwO7cGSJsZwr5C/TU3J/pyrTSewlr/gDBDgRE/gfYkwAAAABJRU5ErkJggg==" width="353" height="307" class="img_ev3q"></p><p>Click the <strong>Launch Droplet Console</strong> button.</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtcAAAFjCAMAAADB49eRAAAC/VBMVEX///8AUv/x8fFnZ2dERETf39//AADntH///85/Z2eY0P//6LZnms/Ommfo//9nZ36YZ2e25/9ngLbx/v/nr26x6P9ERW1xaGeAtOf/z5jP//9nZ5j/9P8Avf///vFnaGxnaIb6/////+hnaHJsaGdEREuSRES+9P/2///V/v9zUv9uRET/5f////Vnc5Zz0/9Fkc//6LH//OhLRESFvfGGaGe2f2b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KtdHrxBy0Khxch8j1a+m19fchouVP1q8TW5O3z3C+pkG8Qkjq2/h9iFy/lmOL7uKs69fio9e283WutE/qtTwIlYYXe7xp5PZie/yTdL1um9v0z9OkxtiR/Rd2nQLqEEm/5/NrGQlARPLHXi+sjS93itUBQLvrNYE+w/Pk9tt9urbN65B/CXv9r71ujc9Nd8wtCUi+yrPgKD6ILcUystf/DPY6Jbw2/M1QfGFW2kLUTFuHvbYDEJH8ba+d7LXNgIiE6xD2mr1O0ms+b7Q1EJH8Ha+Ndb46cp2P7G54P8+5N1lBGdhrm3md5HUZxNG/GK4DKgN7bRev7QV7zV6rCHvNXqvIN3br2MZhGAiAIEXAPX1vbNGZCpBLecCJHRlwJq9mIjI9LA6na10X6VrXRbrWdZGudV2ka10X6VrXRbrWdZGudV2ka10XvU3gsfH0GKf0Rdf7HNc299f72Hg6xil90fW6XTvseVuvz33j6T5OaX7R6tpvV7av8eZ+OEW2x3HSrMe89g4mStcU6ZoiXVOka4p0TZGuKdI1RbqmSNcU6ZoiXVOka4p0TZGuKdI1RbqmSNcU6ZoiXVOka4p0TZGuKdI1RbqmSNcU6ZoiXVOka4p0TZGuKdI1RbqmSNcU6ZoiXVOka4p0TZGuKdI1RbqmSNcU6ZoiXVOka4p0TZGuKdI1RbqmSNcU6ZoiXVOka4p0TZGuKdI1RbqmSNcU6ZoiXVOka4rWXANq/ib8qk9hrwm/aQAAAAAA8N8eHBIAAAAACPr/2g12AAAAAAAAAAAAAAAAAACYAgZTXAbZJ0abAAAAAElFTkSuQmCC" width="727" height="355" class="img_ev3q"></p><p>A new window will open up with a terminal emulator. It will be already logged into my VM.</p><p><img loading="lazy" src="/assets/images/18-7423b1e09783de89620f3ff6aa14569e.png" width="833" height="660" class="img_ev3q"></p><p>This let's me use the Linux distro the same way I work within the terminal.</p><p><strong>One downside of this web-based terminal</strong> is, it's painfully slow. However, this could be my computer. If you experience the same input lag as me, you should stick with the Bash terminal instead.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="installing-basic-pentesting-tools">Installing Basic Pentesting Tools<a href="#installing-basic-pentesting-tools" class="hash-link" aria-label="Direct link to Installing Basic Pentesting Tools" title="Direct link to Installing Basic Pentesting Tools">​</a></h2><p>Now that the pentesting VM is all set, I can go do some practice.</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAApEAAADLCAMAAAABfzhBAAAAsVBMVEUnKCJBQznMzMwqKyXJycktLijHx8cwMSvBwcEzNC6ioqHDw8M+PzrFxcVDRD++vr23t7e8vLtJSkWVlZM8PTiIiYafn560tbS5urk6OzXAwL81NjCnp6WwsK+MjYqFhoOysrGZmZc3ODJUVVCCg4BGR0KQkI6pqah+f3ylpaN3d3Strax7e3icnJtOT0tsbWllZmJ0dHFhYV1RUk1LTEhwcW5paWVeXlpbW1erq6pXWFPsXnc4AAAfNklEQVR42uyY6ZKiSBhFvyaBZN9BQBZBARFccX//B5sEtaqo6a4yJqKNjh7On7rgJSMj6piZAgMDAwMDAwMDAwN/Gcw5SXYwMPAszCYpS/P3OcPHrJzDwMAXoFNiP3Jqh/b1nITrZwXembPvJTfn8AAffL+Gp0HWwnG+mcz4kDf4lGxh4C8BzdnyIU/s1h5CinPZw1Pgmex8vyyKCTxAqWGkT88smwUqzX3jvJdPTuPaj2DgLwHFVPBYLTVz3P496osnjbTp742M2AT+E6nNiVX4nZFScmnSmTqDgT8fyzSlwzIQbKv1bJ2UgTP34C3XHqBDEOiUGARBWQOTaFNoyUYJOpT11SxLs7nv7GW53GIA5iDUZ3I/b4DZBoVOceRZoRWYaTsJ6RBwO/5ybgEmHZXy284WkJGQ4Oy6xsJZnMxSiFbd5lw7Qcty13N5cTlMyzcj+bUT7X9ipFAYXq7Wn2yul1tyJhZiA/DOrBdCvlk7yQYAT2OHzPMwBvDmy0PXyWDgNSiab+o0RYkRAt52WYqi/UQCGL9lFFN3aBM1romv5D+UbKrCi+lLSEpyuQLi3qTt6zYGxqbD7r6jYJu6w0atYiOWJDfGJM/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ozn7bnkcmJA/J49fBoTVHkJRBFtoxBl/cSdfbWQj80qyK1njsmjaZI3V1SwnUSr4rjqEhC8wm/INa3kZixCr58cXVFv5t2mv/G1YxZFdkW5uwVqRW2yhivUt3kJ4s00/Y8cn38Gyfxajiw5yjy+tCkuyQtsY88D5q71qxKeuF7JSF4Gg1auZcF/1CkVjArMYiWp6a7RpGwRRcsfCfGLMvPWiQdx0qtG1EUCTtoKfZ/zvCsRRLaH/gq7zErKEGRcJVQJMgFRQIAAAD8wQ2ATFAkyAVFglxQJMgFRYJcUCTI5QvymfCBCOk+dgAAAABJRU5ErkJggg==" width="657" height="203" class="img_ev3q"></p><p>Since Ubuntu does not come with nmap, I can install using this command:</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">Terminal</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token function" style="color:rgb(220, 220, 170)">apt</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">install</span><span class="token plain"> nmap</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Then run a basic test by doing</p><div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">Terminal</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">nmap scanme.nmap.org</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><img loading="lazy" src="/assets/images/14-a65e2d2d6547a4f8e2a25b92b0b35f36.png" width="794" height="518" class="img_ev3q"></p><p>I won't go any deep into hacking since it's out of scope for this article.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="destroy-the-droplet-to-stop-billing">Destroy the Droplet to Stop Billing<a href="#destroy-the-droplet-to-stop-billing" class="hash-link" aria-label="Direct link to Destroy the Droplet to Stop Billing" title="Direct link to Destroy the Droplet to Stop Billing">​</a></h2><p>One thing I want to mention is when you are not using your droplet for long period of time, it would be a nice idea to just destroy it to avoid racking up bills. You can also pause your droplet but it will still cost you money.</p><p>If you are not actively using your VM, go ahead and destroy it. <strong>Destroying your droplet is irreversible</strong>, so think before your delete.</p><p>I am going to destroy this droplet since I created it for this tutorial.</p><p>Press the three dots:</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUIAAAH9CAMAAABY74UOAAAC/VBMVEX////9/f739/f9/Pz7+/v6+vrf39/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Vz98N0Q9f2W+OEL4HWrfk/3pH63qj4QHDw1sP+rUVWW2eS52bbmc5kkq4eyBfW9WXjfQKQiHD/l8c8mZIcvf4CtjPyCh6rz3eJ26fAEdey/Bdzj77j+9Qi0ujtPogcPnX986hM9Xn2EewhAWk6QSDqYtd+D2QkG4ZioAzL/WH4+7UAgJG/eD6XPCR3xjI3ysP8CZIeFjM4C313rJDs/EvnvNcslVTu/gC7RJLqG6St8xK7IzB7TOPsDYUOLbo3jHt0dJ8hT8mHFX+2lmIcRGPDAIkkzY7kfCVhMHqur5TzERzj+iqu3vrTMPoUjKCQ+rqwZ0v74nBkKc3X1fZcz8dMV/TvjjRD5xDOsGxDaRly28gedCM03kVBCO1suJQTi2aeyE4/sz4eyBNfdTU6MTUi2+cfX486MxTWTcXOZqxwdD/m9CvbU2CKevPoq7Mq6OhRBaYc896uSD/5xQ5MSRsS/N8wHv+5ie8OAVMZ2HNDPRZ+TvY3rCI31vXt1ybsiaK0wYL2GrcwsG0ua0vPrJWhe7emb5o9idUIqD8EKWlOZSXIRS4gjl/2M9ssyEpid02ZnQlRxCN9g2SSB0/A+j0JFYwowZFMUtgU0juRUlQ8aEE2ZQSrrApnGVVDIkkhD03jqXXYeh5M6F8zhxhEY9UfK5XTZElFzufEoCq4kxk6mg5CrpzmS7uEvmcolBmARCNMyatVi2bAUpuSyfgpRs2YplzYqCCSY0rjSQYfZimGy2SDFMdhLUB6FBmIhhKAwRMatIdlskqwgCCsGEDUJjGH41VFwuV1abBP8rylfBhA5CQEHdkBBtFgRMvCBIkbmMA9F2yZxRzOLEEgpBYeggRVsF/RyJFjTGISEKRRuF/BAw4YJkqEcWcdgiMob8kiFojEMjssUj/RhIfCRUtGsgCiAjxsonQVIj2e4Hh8PhcDgcDofD4XA4HA6H8x/lC+Q0qroCM9OmAAAAAElFTkSuQmCC" width="322" height="509" class="img_ev3q"></p><p>Type in the droplet name and hit <strong>Destroy</strong>.</p><p><img loading="lazy" src="/assets/images/20-be63951e04273ff91c31e3ce8e99df5b.png" width="552" height="714" class="img_ev3q"></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="is-it-allowed-to-use-digital-ocean-for-pentesting">Is it Allowed to Use Digital Ocean for Pentesting?<a href="#is-it-allowed-to-use-digital-ocean-for-pentesting" class="hash-link" aria-label="Direct link to Is it Allowed to Use Digital Ocean for Pentesting?" title="Direct link to Is it Allowed to Use Digital Ocean for Pentesting?">​</a></h2><p>Hacking a company website without their explicit written permission is illegal. You should not attempt to use any VM, whether it's local or commercial to hack into sites.</p><p>If we read the <a href="https://www.digitalocean.com/legal/acceptable-use-policy" target="_blank" rel="noopener noreferrer">Digital Ocean's acceptable use policy</a>,</p><blockquote><p><strong>Unauthorized Access.</strong></p><p>Accessing or using any System without permission, including attempting to probe, scan, or test the vulnerability of a System or to breach any security or authentication measures used by a System.</p><p><strong>Interception.</strong></p><p>Monitoring of data or traffic on a System without permission.</p></blockquote><p>This all means that (black hat) hacking is not allowed.</p><p>However, if you are a white hat hacker you should be okay. Because ethical hacking by definition is taking written permission from a company to test their network in a controlled environment. Same goes with pentesting for educational purposes.</p><p>Use Digital Ocean VMs to only connect to your pentesting lab environments. If you do black hat hacking with DO and get caught, you will be liable, not them.</p><p>I hope you found this article helpful. <a href="https://twitter.com/tamalweb" target="_blank" rel="noopener noreferrer">Do let me know your thoughts on Twitter</a>.</p>]]></content:encoded>
            <category>digital ocean</category>
            <category>linux</category>
        </item>
        <item>
            <title><![CDATA[Mastering JSON in ReactJS]]></title>
            <link>https://tamalweb.com/json-reactjs</link>
            <guid>https://tamalweb.com/json-reactjs</guid>
            <pubDate>Tue, 08 Mar 2022 00:00:00 GMT</pubDate>
            <description><![CDATA[When building web apps, you will come across dynamic data created by your app or fetched by a third-party API. JSON is the universal data format for software, so if you master JSON, you will be a dangerous frontend engineer.]]></description>
            <content:encoded><![CDATA[<p>When building web apps, you will come across dynamic data created by your app or fetched by a third-party API. JSON is the universal data format for software, so if you master JSON, you will be a dangerous frontend engineer.</p><p><img loading="lazy" alt="mastering json in react" src="/assets/images/feature-07ad4b3c783dbba3ffc194345c1736c9.png" width="1200" height="630" class="img_ev3q"></p><p>My article is all about mastering JSON with ReactJS so strap in!</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-json-in-reactjs">What is JSON in ReactJS?<a href="#what-is-json-in-reactjs" class="hash-link" aria-label="Direct link to What is JSON in ReactJS?" title="Direct link to What is JSON in ReactJS?">​</a></h2><p><strong>JavaScript Object Notation</strong> is part of the core JavaScript language, not ReactJS. Since React is a JS library, it can access everything that the language supports. This data format is universal and can be used in any programming language or platform for data exchange from Python, PHP, Kotlin to Ruby, you name it.</p><p>In JavaScript, there is a global object called <code>JSON</code> which gives you only two methods to work with its data format:</p><ol><li><code>JSON.parse()</code></li><li><code>JSON.stringify()</code></li></ol><p>JSON is just a simple JavaScript object where the properties and values are wrapped around double-quotes.</p><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">freddy.json</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"Title"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"Friday the 13th"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"Year"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"2009"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"Rated"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"R"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"Released"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"13 Feb 2009"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"Runtime"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"97 min"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"Genre"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"Horror, Mystery, Thriller"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"Director"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"Marcus Nispel"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>This way we can easily send the object as a long string of text. And as you know, in computers, text take so little disk space.</p><p><code>{"Title":"Friday the 13th","Year":"2009","Rated":"R","Released":"13 Feb 2009","Runtime":"97 min","Genre":"Horror, Mystery, Thriller","Director":"Marcus Nispel"}</code></p><p>You might notice, JSON looks just like JS objects.</p><p>A JavaScript object is a combination of other primitive data types like String, Number, and Boolean.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">script.js</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> jason </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">name</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Jason Voorhees'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">age</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">74</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">hasKilled</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">birthday</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'June 13, 1946'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Objects can also contain other objects and arrays, making them complex objects.</p><p>When you transform a JS object into JSON, all of it's properties and values will be wrapped in double quotes <code>" "</code> (except numbers and boolean).</p><p><strong>Original JS object:</strong></p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">data.js</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> person </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">name</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Jason Voorhees'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">age</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">74</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">hasKilled</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">birthday</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'June 13, 1946'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p><strong>Converted JSON:</strong></p><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">data.json</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"name"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"Jason Voorhees"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"age"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">74</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"hasKilled"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token property">"birthday"</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"June 13, 1946"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Let's talk about what are some basic operations with this format in Reactjs,</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-read-json-data-in-react">How to Read JSON Data in React?<a href="#how-to-read-json-data-in-react" class="hash-link" aria-label="Direct link to How to Read JSON Data in React?" title="Direct link to How to Read JSON Data in React?">​</a></h2><p>To read data from JSON, you have to convert it into an object using the <code>JSON.parse()</code> method. When you receive some JSON from an API or from a file, it's like a long piece of text (String data).</p><p>Most JSON data will be wrapped around a pair of curly braces <code>{ }</code>, <strong>JSON.parse()</strong> will always return an object with properties you have to access.</p><p>I got this JSON from the <a href="https://jsonplaceholder.typicode.com/posts" target="_blank" rel="noopener noreferrer">JSON Placeholder API</a></p><p><img loading="lazy" alt="sample JSON from json placeholder" src="/assets/images/1-97e17b5b9658066679863c3022d3bea0.png" width="805" height="581" class="img_ev3q"></p><p>As you can see, in this example the entire JSON response is wrapped with square brackets <code>[]</code>.</p><p>This means the entire JSON is an array for us to map over.</p><p>We will parse it using <code>JSON.parse()</code>.</p><p><strong>Step 1:</strong> Parse it,</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> data </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token known-class-name class-name" style="color:rgb(78, 201, 176)">JSON</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">parse</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">jsonString</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>This will create a new array object and save it into the <code>data</code> constant.</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_S0QG"><p><strong>parse</strong> is a computer science word for changing some data into machine readable format.</p></div></div><p><strong>Step 2:</strong> access it's properties,</p><p>Since it's an array, I am accessing the first item's <code>title</code> property.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token number" style="color:rgb(181, 206, 168)">0</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">title</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// &gt;&gt; "sunt aut facere repellat provident..."</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>But normally, when you get a response back from the server, the response data also contains a few header info.</p><p>It depends on how the API designer has created the JSON response. There will be a data property with the actual data you are looking for.</p><p>Let's take a look at the <a href="https://api.weather.gov/points/39.7456,-97.0892" target="_blank" rel="noopener noreferrer">weather API here</a>,</p><p><img loading="lazy" alt="weather API data" src="/assets/images/2-fab11efad153986f1190696f0421e3d3.png" width="920" height="594" class="img_ev3q"></p><p>In this example the entire JSON is an object and the actual data we need is under the <code>properties</code> field. Sometimes the actual data is deeply nested in the json which you have to find out.</p><div class="theme-admonition theme-admonition-tip alert alert--success admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_S0QG"><p>Since JSON responses can vary from API to API, it's advised to do a <code>console.log()</code> to check the shape of the JSON response. You can also open it on a new tab and explore it using a browser extension called <a href="https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh?hl=en-US" target="_blank" rel="noopener noreferrer"><strong>JSON Viewer</strong></a>.</p></div></div><p>Here, I am calling this example API, getting the JSON response back, and converting it to an object by parsing it.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">script.js</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token function" style="color:rgb(220, 220, 170)">fetch</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'https://jsonplaceholder.typicode.com/posts'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">then</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">json</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">then</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">resJson</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> data </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token known-class-name class-name" style="color:rgb(78, 201, 176)">JSON</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">parse</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">resJson</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Now that I have the data saved in a variable, the next task would be to save this data in a state for my React app to display.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-do-i-show-json-in-reactjs">How do I Show JSON in Reactjs?<a href="#how-do-i-show-json-in-reactjs" class="hash-link" aria-label="Direct link to How do I Show JSON in Reactjs?" title="Direct link to How do I Show JSON in Reactjs?">​</a></h2><p>To show JSON data in Reactjs you can use hooks. You have to store the parsed data in your local state and let the app handle the display of the data.</p><p>Often times when we get some data back from the API, the data is an array of objects. We can cycle through each of the objects using the <code>Array.map()</code> method and display them with our own react component.</p><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">App.jsx</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token plain"> </span><span class="token function maybe-class-name" style="color:rgb(220, 220, 170)">MyComponent</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line theme-code-block-highlighted-line" style="color:#9CDCFE"><span class="token plain">    items</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">map</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">item</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag class-name" style="color:rgb(78, 201, 176)">SubComponent</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">title</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(212, 212, 212)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token tag script language-javascript" style="color:rgb(78, 201, 176)">item</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token tag script language-javascript property-access" style="color:rgb(78, 201, 176)">title</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">/&gt;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>This is a common pattern you will see in React:</p><ol><li>Get the data in JSON</li><li>Convert and save it in the local state</li><li>Map over the data from state</li><li>React will render the components automatically.</li></ol><p>Here's the full example with a working component:</p><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">App.jsx</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line theme-code-block-highlighted-line" style="color:#9CDCFE"><span class="token keyword module" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> </span><span class="token imports punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token imports"> useState</span><span class="token imports punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token imports"> useEffect </span><span class="token imports punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> </span><span class="token keyword module" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'React'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token plain"> </span><span class="token function maybe-class-name" style="color:rgb(220, 220, 170)">MyComponent</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line theme-code-block-highlighted-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token plain">items</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> setItems</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">useState</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token function" style="color:rgb(220, 220, 170)">useEffect</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token function" style="color:rgb(220, 220, 170)">fetch</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'https://jsonplaceholder.typicode.com/posts'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">      </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">then</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">json</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">      </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">then</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">resJson</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">        </span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> data </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token known-class-name class-name" style="color:rgb(78, 201, 176)">JSON</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">parse</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">resJson</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">        </span><span class="token function" style="color:rgb(220, 220, 170)">setItems</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    items</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">map</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">item</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag class-name" style="color:rgb(78, 201, 176)">SubComponent</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">key</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(212, 212, 212)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token tag script language-javascript" style="color:rgb(78, 201, 176)">item</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token tag script language-javascript property-access" style="color:rgb(78, 201, 176)">id</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">title</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(212, 212, 212)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token tag script language-javascript" style="color:rgb(78, 201, 176)">item</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token tag script language-javascript property-access" style="color:rgb(78, 201, 176)">title</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">/&gt;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="how-do-i-show-json-in-reactjs-literally">How do I show JSON in Reactjs? (Literally)<a href="#how-do-i-show-json-in-reactjs-literally" class="hash-link" aria-label="Direct link to How do I show JSON in Reactjs? (Literally)" title="Direct link to How do I show JSON in Reactjs? (Literally)">​</a></h3><p>When you want to show the JSON data as is in your React app, you can simply wrap this data inside a code block like this:</p><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">code</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">code</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Giving you a nice code output.</p><p>But let's not get sidetracked, and talk about how can you create JSON and send it to the backend,</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-convert-json-object-to-string-in-react-js">How to Convert JSON Object to String in React JS?<a href="#how-to-convert-json-object-to-string-in-react-js" class="hash-link" aria-label="Direct link to How to Convert JSON Object to String in React JS?" title="Direct link to How to Convert JSON Object to String in React JS?">​</a></h2><p>To convert a JSON object to a string, you need to run it with <code>JSON.stringify()</code> method. The stringify method takes an object and returns a JSON string version ready to send to the server or store in localStorage.</p><p>Have your object ready, stringify it:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">script.js</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> jsonString </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token known-class-name class-name" style="color:rgb(78, 201, 176)">JSON</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">stringify</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="sending-json-with-fetch-api">Sending JSON with fetch() API:<a href="#sending-json-with-fetch-api" class="hash-link" aria-label="Direct link to Sending JSON with fetch() API:" title="Direct link to Sending JSON with fetch() API:">​</a></h3><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">script.js</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> jsonString </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token known-class-name class-name" style="color:rgb(78, 201, 176)">JSON</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">stringify</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token function" style="color:rgb(220, 220, 170)">fetch</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'THE_URL'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">method</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'POST'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">headers</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> </span><span class="token string-property property">'Content-Type'</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'application/json'</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">body</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> jsonString</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">then</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">catch</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">err</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="storing-json-to-browser-using-localstorage-api">Storing JSON to browser using localStorage API:<a href="#storing-json-to-browser-using-localstorage-api" class="hash-link" aria-label="Direct link to Storing JSON to browser using localStorage API:" title="Direct link to Storing JSON to browser using localStorage API:">​</a></h3><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockTitle_Ktv7">script.js</div><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> jsonString </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token known-class-name class-name" style="color:rgb(78, 201, 176)">JSON</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">stringify</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token dom variable" style="color:rgb(156, 220, 254)">localStorage</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">setItem</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">nameOfData</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> jsonString</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-do-i-load-a-json-file-into-react-js">How do I load a JSON file into React JS?<a href="#how-do-i-load-a-json-file-into-react-js" class="hash-link" aria-label="Direct link to How do I load a JSON file into React JS?" title="Direct link to How do I load a JSON file into React JS?">​</a></h2><p>To load JSON from file, you have to have the raw <code>.json</code> file saved in your <code>/src</code> directory. In Create React App, you can directly import the JSON file and it will work as if it were a JS object, no need to parse it again.</p><p>To load JSON from file, import it into your component.</p><p>Now access the properties as you do with regular objects.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword module" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> </span><span class="token imports">data</span><span class="token plain"> </span><span class="token keyword module" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'./data.json'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">title</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// &gt;&gt; "some data"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="when-and-why-should-you-load-json-from-a-file">When and Why should you load JSON from a file?<a href="#when-and-why-should-you-load-json-from-a-file" class="hash-link" aria-label="Direct link to When and Why should you load JSON from a file?" title="Direct link to When and Why should you load JSON from a file?">​</a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="during-development">During Development<a href="#during-development" class="hash-link" aria-label="Direct link to During Development" title="Direct link to During Development">​</a></h3><p>When you are building and testing your app, you don't want to exhaust the API server by calling the API every few seconds. And it's a slow process to keep calling it and waiting for a response.</p><p>Just make one API call, grab the JSON and save it into a local file for the testing and design time.</p><p>Then when you are ready for production, swap out the local loading to API loading.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="to-save-loading-times">To Save Loading Times<a href="#to-save-loading-times" class="hash-link" aria-label="Direct link to To Save Loading Times" title="Direct link to To Save Loading Times">​</a></h3><p>Sometimes the data is not dynamic, and you can just ship that into your application.</p><p>Like when I created The <a href="/periodic-table-reactjs">Periodic Table website</a>, I had to bring the 118 Atoms info in a JSON. Now they are not going to change that frequently. Instead of making a call every time the app loads, I can just have it loaded from a local file.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="to-save-disk-space">To Save Disk Space<a href="#to-save-disk-space" class="hash-link" aria-label="Direct link to To Save Disk Space" title="Direct link to To Save Disk Space">​</a></h3><p>JSON files can be huge too! In some cases, you want to ship a small sub-set of the data to get the app loading quickly with info.</p><p>Let's say you are building a bible verses app.</p><p>Having the entire bible in a JSON would take a lot of disk storage and can hamper the loading times.</p><p>You can have a small section already loaded into your app from file and whenever the user requests more verses, you can call them on demand from the API.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="conclusion">Conclusion:<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion:" title="Direct link to Conclusion:">​</a></h2><p>To recap what we learned in this post,</p><ul><li>Convert JSON string to object using <code>JSON.parse()</code></li><li>Convert a data object into JSON string with <code>JSON.stringify()</code></li><li>Create React App can automatically convert a json to object when you import a .json file</li></ul><p><strong>Read Next: <a href="/compress-images-reactjs">Best Practices on How to Compress Images For Reactjs</a></strong></p>]]></content:encoded>
            <category>reactjs</category>
        </item>
        <item>
            <title><![CDATA[Best Practices on How to Compress Images For Reactjs]]></title>
            <link>https://tamalweb.com/compress-images-reactjs</link>
            <guid>https://tamalweb.com/compress-images-reactjs</guid>
            <pubDate>Sat, 04 Dec 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[In this quick tutorial, I will walk you through some of the best ways you can compress images for Reactjs for huge performance wins.]]></description>
            <content:encoded><![CDATA[<p>In this quick tutorial, I will walk you through some of the best ways you can compress images for Reactjs for huge performance wins.</p><p><img loading="lazy" alt="featured image" src="/assets/images/compress-images-7a341e62f7dfa2435416c6c89c65a611.png" width="1200" height="630" class="img_ev3q"></p><p>As you can see on the cover image, the original file was 65 kB, and after compression, I got it down to 5 KB, that’s over 80% saving for just one image file.</p><p>This file is from one of my side projects <a href="https://reactionpoll.com" target="_blank" rel="noopener noreferrer">ReactionPoll</a>, where I make use of a bunch of Facebook and Linkedin reaction icons. My original reaction set for Facebook was 155 kB and after optimizing them, I got it to just 35 kB!</p><p>Let’s begin with the obvious,</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="import-images-into-your-react-source-code">Import images into your React source code<a href="#import-images-into-your-react-source-code" class="hash-link" aria-label="Direct link to Import images into your React source code" title="Direct link to Import images into your React source code">​</a></h2><p>The first quick win is to always import your images in your source code.</p><p>Add the images into the src directory. For me, I created a folder called <code>img</code> inside the src folder and put all the image assets inside.</p><p>Now from your component files, just type in</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword module" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> </span><span class="token imports">like</span><span class="token plain"> </span><span class="token keyword module" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'../img/src/like.png'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You can insert this image in the src attribute in the img tag like this:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token operator" style="color:rgb(212, 212, 212)">&lt;</span><span class="token plain">img src</span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain">like</span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> alt</span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token string" style="color:rgb(206, 145, 120)">"like icon"</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">/</span><span class="token operator" style="color:rgb(212, 212, 212)">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>When you import images this way, create-react-app (or webpack) will bundle all your images and try to best compress them.</p><div class="theme-admonition theme-admonition-warning alert alert--danger admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>Note</div><div class="admonitionContent_S0QG"><p>Don’t put your images in the <code>/public</code> directory and hotlink them, unless you have a strong reason to do so (Hadar, 2021).</p></div></div><p>If your images are less than 10 kB (10,000 bytes) these images will be converted into inline base 64 strings. So they will load instantly (Llobera, 2020).</p><p>See this love icon is 4.5 kB (less than 10 kB) and converted as a data URL:</p><p><img loading="lazy" alt="images converted to data url" src="/assets/images/1-80385a578d72ffd2b15094f0992a9ac9.png" width="877" height="521" class="img_ev3q"></p><p>But when your images are over 10 KB, for example, this care reaction icon is 14 kB, react will link to the asset file.</p><p><img loading="lazy" alt="source image" src="/assets/images/2-d50f74ca0e68f48476c75c2b0ad7fb1c.png" width="852" height="495" class="img_ev3q"></p><p>Did you know about the inline image thing? I didn’t. Tweet this to your followers,</p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Tweet Worthy</div><div class="admonitionContent_S0QG"><p>If your image is under 10 kB, Create React App will turn them into base64 data strings, making them load instantly!</p><p><a href="https://twitter.com/intent/tweet?url=https://tamalweb.com/compress-images-reactjs&amp;text=If%20your%20image%20is%20under%2010%20kB,%20Create%20React%20App%20will%20turn%20them%20into%20base64%20data%20strings,%20making%20them%20load%20instantly!%20via%20@tamalweb" target="_blank" rel="noopener noreferrer"><img loading="lazy" alt="click to tweet button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAgCAYAAABXTzdxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgaSURBVHgB7ZttbFNVGMefe9vupZuwYVQiKyGCgFt0YCDCSAx+cOODqEFeEhOjqHwzmg2N+glm9IvJNmNi/CAL4icBY0gkkZIYMChdeImMBNCEmYWObNMAY29t1zfP/7S3u70vvb1tL53j/Egz2nvvuec89/mf5znPaSViLDt4Z1lcdh+UKLkmSVRHAsH9jCQdc8Vj7YO76wcliCMhu/4QwhAIshhzJeJr5bjL1SPEIRDoqItJroMyJellEggEOiSJ1sgkEAjMqBMCEQhyIAQiEOTAcYFUuyVysWROIPg/4iabLKyQ6O5M0vK8F5e56d0nK2llfUqDZ4fj9H4gRMNTRC2LZboVTtLVOwkSCOYyku/QuLW3p6l0SXT6JS+9cyZEF/81d+6tTBxfPVut+zzKLgnHkzQ4nqAd/hBNx/K+tW0WMCHvWO7mf8eZoP3BGA1Nzt6voVamjYtd5L8R48eNaFwk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v5i9FnvxgygiaGF0WghCML8o6jsJkMOwEIVgHiN+ky4Q5EAIRCDIAX4AOEYCgcAQma0gLpFAINCTpGNyNBHfLaKIQKAlORZNxtvlkd31gzOJ+FpWsz1GAsF9T3IsmaTT0URiLbTxHx1jLOKZy1CEAAAAAElFTkSuQmCC" width="200" height="32" class="img_ev3q"></a></p></div></div><p>To further compress these source images, we have to optimize them ourselves,</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="compress-your-source-images-using-tinypng">Compress Your Source Images Using TinyPNG<a href="#compress-your-source-images-using-tinypng" class="hash-link" aria-label="Direct link to Compress Your Source Images Using TinyPNG" title="Direct link to Compress Your Source Images Using TinyPNG">​</a></h2><p><a href="https://tinypng.com" target="_blank" rel="noopener noreferrer">TinyPNG</a> is an online tool I use to compress images. Usually optimized PNG and JPGs have a small file size already, but when I run these images against this free tool, I get surprised that it squeezes up even more.</p><p><img loading="lazy" alt="tiny png" src="/assets/images/3-16dc37152d969b0422b79f36adc94e5c.jpg" width="1581" height="722" class="img_ev3q"></p><p>I saw a 68% savings when compressing my reaction icon pngs using TinyPNG.</p><p>Compressed JPG and PNGs can only take you so far. If you want to really up your compression game, you need to find an even better image format: webp and avif.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-webpavif-images-for-even-better-compression">Use Webp/Avif Images for Even Better Compression<a href="#use-webpavif-images-for-even-better-compression" class="hash-link" aria-label="Direct link to Use Webp/Avif Images for Even Better Compression" title="Direct link to Use Webp/Avif Images for Even Better Compression">​</a></h2><p>Webp (weppy) is a new fast image format developed by Google. If weppy is fast, then AVIF is faster. In my ReactionPoll tool, I used weppy images to further compress my images.</p><p><img loading="lazy" alt="webp image converter" src="/assets/images/4-7c8a48b3d6eebf99b978d9e00ed4f47d.png" width="943" height="487" class="img_ev3q"></p><p>What I did was to replace all images with their webp counterparts.</p><p>There is a weppy converter tool called cwebp that I downloaded and installed into my computer, but I was too lazy to compress them in CLI. So I used an online converter to convert my existing PNG files to webp.</p><p>The weppy versions helped cut down around 20% more file sizes from my already compressed PNG files.</p><p>You should keep in mind that, weppy and avif are newer file formats and not available in older browsers. It’s a good idea to serve webp but also fall back to the jpg/pngs.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-webp-and-png-together-with-fallbacks">Use Webp and PNG together with Fallbacks<a href="#use-webp-and-png-together-with-fallbacks" class="hash-link" aria-label="Direct link to Use Webp and PNG together with Fallbacks" title="Direct link to Use Webp and PNG together with Fallbacks">​</a></h2><p>Using the <code>&lt;picture&gt;</code> tag we can add both webp and png files. The browser will pick the image that it supports.</p><p>The tag looks like this:</p><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword module" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> </span><span class="token imports">likePng</span><span class="token plain"> </span><span class="token keyword module" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'../img/src/like.png'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword module" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> </span><span class="token imports">likeWebp</span><span class="token plain"> </span><span class="token keyword module" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'../img/src/like.webp'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">picture</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain-text"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain-text">  </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">source</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">srcSet</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(212, 212, 212)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token tag script language-javascript" style="color:rgb(78, 201, 176)">likeWebp</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">type</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(212, 212, 212)">=</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">image/webp</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">/&gt;</span><span class="token plain-text"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain-text">  </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">img</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">src</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(212, 212, 212)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token tag script language-javascript" style="color:rgb(78, 201, 176)">likePng</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">alt</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(212, 212, 212)">=</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">like button</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">/&gt;</span><span class="token plain-text"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain-text"></span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">picture</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>I learned how to use this trick + how to use a reusable react component to automate the process using <a href="https://www.joshwcomeau.com/performance/embracing-modern-image-formats/#abstraction-with-react" target="_blank" rel="noopener noreferrer">Josh’s blog post</a>.</p><p>Basically what he did was create a component called <code>ImgWithFallback</code></p><div class="language-jsx codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-jsx codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> </span><span class="token maybe-class-name">ImgWithFallback</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  src</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  fallback</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  type </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'image/webp'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token spread operator" style="color:rgb(212, 212, 212)">...</span><span class="token plain">delegated</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">picture</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain-text"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain-text">      </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">source</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">srcSet</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(212, 212, 212)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token tag script language-javascript" style="color:rgb(78, 201, 176)">src</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">type</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(212, 212, 212)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token tag script language-javascript" style="color:rgb(78, 201, 176)">type</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">/&gt;</span><span class="token plain-text"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain-text">      </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">img</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">src</span><span class="token tag script language-javascript script-punctuation punctuation" style="color:rgb(212, 212, 212)">=</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token tag script language-javascript" style="color:rgb(78, 201, 176)">fallback</span><span class="token tag script language-javascript punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag spread punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token tag spread operator" style="color:rgb(212, 212, 212)">...</span><span class="token tag spread" style="color:rgb(78, 201, 176)">delegated</span><span class="token tag spread punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">/&gt;</span><span class="token plain-text"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain-text">    </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">picture</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>This component will take the webp image as the src and the png as the fallback image.</p><p>Use webp/avif images for faster loading but also have a fallback to png/jpeg files using a <code>&lt;picture&gt;</code> tag.</p><p>After adding the WEBPs, I can say my images are loading much quicker than PNGs.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="my-results">My Results<a href="#my-results" class="hash-link" aria-label="Direct link to My Results" title="Direct link to My Results">​</a></h2><p>I started with original reaction icons that I downloaded from the internet. After resizing all the icons into 250×250 png images, the total file size for the seven icons was 155 kB.</p><p><img loading="lazy" alt="compression results" src="/assets/images/5-15b1fd7d6125f7f882768035fa0681ca.png" width="848" height="644" class="img_ev3q"></p><p>After compressing the PNGs with TinyPNG service, I ended up with 50 kB file size for all of them.</p><p>Finally, when I converted them to webp file format, I ended up with 35 kB file size, that leaves 5 kB per image icon.</p><p>Now you must be looking at the picture above and thinking, why the weppy images look pixelated? I don’t know why it is displaying like this on my computer, but when I open both icons side by side, I can say they look fine,</p><p><img loading="lazy" alt="side by side comparison" src="/assets/images/6-5e096d8c9870b019df054ea8563d5f3d.jpg" width="1545" height="955" class="img_ev3q"></p><p>By the way, all these icons you see are part of my Linkedin and Facebook reaction poll generator. If you want to check out my project in action and how the images perform, visit ReactionPoll.com/facebook</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="final-thoughts">Final Thoughts<a href="#final-thoughts" class="hash-link" aria-label="Direct link to Final Thoughts" title="Direct link to Final Thoughts">​</a></h2><p>Image compression and performance optimization is ongoing thing. As time goes, we will surely find out more ways to shave off those extra kilobytes without compromising the quality. When that happens, I will update this article with newer tricks as I learn them.</p><p>Till then start optimizing your react website and send me a tweet if you found this post useful.</p><p><strong>To recap what we learned so far:</strong></p><ul><li>Always import your images in reactjs</li><li>Compress your assets using a tool like TinyPNG (it also works with jpegs)</li><li>Use webp and avif image formats for fast loading but also have fallbacks for the browsers that don’t support them</li></ul><p>Check out adding <a href="/google-analytics-with-reactjs">Google Analytics 4 in ReactJS</a></p><div class="theme-admonition theme-admonition-info alert alert--info admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>Sharing is Caring</div><div class="admonitionContent_S0QG"><p>I learned some Best Practices on How to Compress Images For Reactjs</p><p><a href="https://twitter.com/intent/tweet?url=https://tamalweb.com/compress-images-reactjs&amp;text=I%20learned%20some%20Best%20Practices%20on%20How%20to%20Compress%20Images%20For%20Reactjs&amp;20via%20@tamalweb" target="_blank" rel="noopener noreferrer"><img loading="lazy" alt="click to tweet button" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAgCAYAAABXTzdxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgaSURBVHgB7ZttbFNVGMefe9vupZuwYVQiKyGCgFt0YCDCSAx+cOODqEFeEhOjqHwzmg2N+glm9IvJNmNi/CAL4icBY0gkkZIYMChdeImMBNCEmYWObNMAY29t1zfP/7S3u70vvb1tL53j/Egz2nvvuec89/mf5znPaSViLDt4Z1lcdh+UKLkmSVRHAsH9jCQdc8Vj7YO76wcliCMhu/4QwhAIshhzJeJr5bjL1SPEIRDoqItJroMyJellEggEOiSJ1sgkEAjMqBMCEQhyIAQiEOTAcYFUuyVysWROIPg/4iabLKyQ6O5M0vK8F5e56d0nK2llfUqDZ4fj9H4gRMNTRC2LZboVTtLVOwkSCOYyku/QuLW3p6l0SXT6JS+9cyZEF/81d+6tTBxfPVut+zzKLgnHkzQ4nqAd/hBNx/K+tW0WMCHvWO7mf8eZoP3BGA1Nzt6voVamjYtd5L8R48eNaFwkU9MiFx29HtUda1vqpsa0+CF0tKM9jomkbyRu2GaAfT40mcjqL67JRZCdr24PY2jzufi1/NhoPGuMpLFHPu3jeiO7mNlLbSPlHCP4M2DXWvUD7eA4zjNDaSufZ1gstiLIw9USLWGdOtxWQ5+eD9O3f+kdR2bj+vjpKsPrPcyf3CzdmmSXvb7KQ19fmSEneOuJCtq3vpI7IB66r9bF3ldRT/8Me0X4Ob5aibpaqig4Mc0dy4g2n5vamyuzBIKHcqTVyx4g0ZXbqetwzpXbCdp1cjrzoPatq6LAaFTn0Ac2e1mf4jrRwSHan6rIeo+XWkS4R99IKHPP9uaKzBgxZgiy83yETgZjurHk237nhQi3CyVDdHQgprJFyoZae3Wwfiypkfh4FJuq21RAHxWB4BzY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pNQdPN4wtlan7Q/oPuuRwhp/EHo5nURg0cyqzKlC9K3o9yrpadKzw65x+PzjoPqmi4HiLKtQlmBZwC7WAsRmNEH1BRKxZ/MM7b376iIisapJwyVQiAEMv5bYjU3pOzaWtBAkGaYDdVOIHZdMD5ciD2IbBphMqRkh4gl/5mc7VuJxrgHBxXvxoXGZsFjoJIAOdEJELbeKG0DIdRNiGNgGPtYVUuVALRl2JAmRlgjOivMkaUkjHGUthZWYegUqX9lkDfaIzbzSx6GNlUu25dUuuyPMcKTAjYDypmwrGi4HwDeeYvLNxuYxWL7RZ19+uscvVhIEz3AjxUVIy6NlXSzy/UZD5HKMYGnbZKAufWcnRghjmhsbNjpxk71vvXz0YC3HP/ubClYyJnxobXgeeqeYqSS1BW7WCjEmNUl9XhyIp4SgEmBEQk7XoCEaS9OSUUI4xsCpZ+N5H5f0czonlFznOsQPkZdkR/nNpEtPVdLDU1boleXenhs+mjNeYKPsc6/h5bqN4sQ3VigUfilRJElGI354xoSI97qIyVF6fHONfB+J0ct60IghCIaLGCrUFW1cnkdef+QtmXbM1xgJX3EmV6bjDcePHpuClDc6Ak6fQY5zpOTwq2BMK/gTqRpDfYIhW/81hdly0Q7JKjuvXrzTgd+jN6X85ogvlFwSkWv5i9FnvxgygiaGF0WghCML8o6jsJkMOwEIVgHiN+ky4Q5EAIRCDIAX4AOEYCgcAQma0gLpFAINCTpGNyNBHfLaKIQKAlORZNxtvlkd31gzOJ+FpWsz1GAsF9T3IsmaTT0URiLbTxHx1jLOKZy1CEAAAAAElFTkSuQmCC" width="200" height="32" class="img_ev3q"></a></p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="references">References<a href="#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References">​</a></h2><ol><li>Hadar, A. (2021) Using the Public Folder, Retrieved December 4, 2021, from <a href="https://create-react-app.dev/docs/using-the-public-folder" target="_blank" rel="noopener noreferrer">https://create-react-app.dev/docs/using-the-public-folder</a></li><li>Llobera, L. (2020) Adding Images, Fonts, and Files, Retrieved Decmber 4, 2021, from <a href="https://create-react-app.dev/docs/adding-images-fonts-and-files" target="_blank" rel="noopener noreferrer">https://create-react-app.dev/docs/adding-images-fonts-and-files</a></li></ol><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments:<a href="#comments" class="hash-link" aria-label="Direct link to Comments:" title="Direct link to Comments:">​</a></h2><p><strong>Cindy Lam:</strong> Hi Tamal, This is such a great and well-written article. I can tell you put a lot of effort and thoughts into writing this blog post. I really like the flow of the entire post. The use of screenshots and images are really helping you to tell your story. To me, as a reader, I do not feel exhausted reading through it and I even get some surprises like the “tweet” option for me to easily tweet what I have learned from your blog post to others. Fast and convenient! More importantly, I really like the “table of contents” and the recaps at the end of the blog post.</p><p>Here are some of my opinions and suggestions that hopefully can help you out to improve the current blog post (I am just writing down what I hope to see as a reader when reading through the blog post):</p><p>(1) The “Care Reaction” icon compression results in using TinyPNG and Webp methods – I know you have displayed screenshots regarding the file size of the care reaction before compression. I think it would be helpful to see this throughout all the other sections to see the progression of the compression. It gives readers more excitement when they are able to see the result immediately after reading sections 2 and 3.</p><p>(2) Included the “Can I use” link for Webp and AVIF – ie, <a href="https://caniuse.com/?search=webP%20image%20format" target="_blank" rel="noopener noreferrer">can i use</a> so the reader can click on the link and directly see the browser compatibility of these two image types.</p><p>(3) For Josh’s blog post, I think it would be best if you could just link directly to the <a href="https://www.joshwcomeau.com/performance/embracing-modern-image-formats/#abstraction-with-react" target="_blank" rel="noopener noreferrer">“Abstraction with React”</a>. As a reader, I do not need to scroll all the way down to the source code.</p><p>The above items are just my opinions and hopefully, they can be slightly helpful to you if you are looking for optimization.</p><p>By the way, I have found a small typo in section 3 the last paragraph right after the bold text, you have Webp spelled incorrectly.</p><p>Overall, I really enjoy reading this post and learning something new regarding image compression! Great post, Tamal!</p><blockquote><p>Tamal: Hey Cindy, thank you for a very thoughtful comment.</p><p>Let me write some quick responses to your points below:</p><ol><li>You are right. Gonna update with some more before/after screenshots.</li><li>Good idea! I am gonna put them.</li><li>Sure, will add the direct link.
Typo: I intentionally wrote Weppy -it’s like a human-friendly &gt;name of the technical WebP.</li></ol></blockquote><p><strong>Jose Oropeza</strong>: Excellent article Tamal. I honestly never considered image compression but will surely give this a try on a future project, specially since image quality is not compromised. Would love to see an article on best practices for optimizing gifs.</p><blockquote><p>Tamal: Definitely! Google web dev recommends web video in place of gifs to save data. But I’ll def look into it.</p></blockquote><p><strong>Christiaan:</strong> So if I understand it correctly all images below 10k are in lined. So in the last step both the PNG and webp are in lined.
So aren’t you shipping 35Kb more in the last example?</p><blockquote><p>Tamal: Only pngs are getting inlined, so in the last step, I am keeping both webp and png because of backwards compatibility.</p></blockquote>]]></content:encoded>
            <category>reactjs</category>
            <category>performance</category>
        </item>
        <item>
            <title><![CDATA[How to Add the New Google Analytics 4 in Reactjs App]]></title>
            <link>https://tamalweb.com/google-analytics-with-reactjs</link>
            <guid>https://tamalweb.com/google-analytics-with-reactjs</guid>
            <pubDate>Fri, 19 Nov 2021 00:00:00 GMT</pubDate>
            <description><![CDATA[You probably know about the react-ga npm package but the sad news is, it does not work with the latest Google Analytics 4 version. It works with the old UA-0000-01 tags, but not with the G-XXXXXX tags. I’m sure an updated version of the package will solve it, but for the time being, I found a better and a working method of adding GA to your React application. And it’s so obvious, you will feel like, "why didn’t I think about it before?"]]></description>
            <content:encoded><![CDATA[<p>You probably know about the react-ga npm package but the sad news is, it does not work with the latest Google Analytics 4 version. It works with the old <code>UA-0000-01</code> tags, but not with the <code>G-XXXXXX</code> tags. I’m sure an updated version of the package will solve it, but for the time being, I found a better and a working method of adding GA to your React application. And it’s so obvious, you will feel like, "why didn’t I think about it before?"</p><p><img loading="lazy" alt="featured" src="/assets/images/featured-c4c54eced3257c95a48a755421aa04b6.png" width="1200" height="630" class="img_ev3q"></p><p>So how to add the new Google Analytics 4 in Reactjs app? <strong>You simply copy the Google Analytics script tag into the <code>&lt;head&gt;</code> section of your index.html file in the public directory.</strong></p><p>Yeah, I know right, it’s that obvious. I found it by trial and error. If you stick around, I will show you a step-by-step guide and also give you a glimpse at how did I figure it out.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="step-by-step-guide-to-adding-script-tag-in-reactjs-app">Step-by-Step Guide to Adding Script Tag in Reactjs App<a href="#step-by-step-guide-to-adding-script-tag-in-reactjs-app" class="hash-link" aria-label="Direct link to Step-by-Step Guide to Adding Script Tag in Reactjs App" title="Direct link to Step-by-Step Guide to Adding Script Tag in Reactjs App">​</a></h2><p>Create a new property in Google Analytics.</p><p><img loading="lazy" src="/assets/images/1-b012a71fdd267c7f8b47ab25d481b2d2.png" width="1391" height="874" class="img_ev3q"></p><p>Don’t select advanced and Universal tracking. Just click next.</p><p>Enter the usual business info and move on to create.</p><p><img loading="lazy" src="/assets/images/2-93a37cd497bc28c48d84ec34c9a0b330.png" width="886" height="747" class="img_ev3q"></p><p>Now after the setup, pick the “web” data stream.</p><p><img loading="lazy" src="/assets/images/3-5f6f54dccbd02c51293b19513642a879.png" width="1285" height="649" class="img_ev3q"></p><p>Enter your website URL and continue.</p><p><img loading="lazy" src="/assets/images/4-ee8222e7576e8bd4c8c6b794a3ddfacb.png" width="1528" height="868" class="img_ev3q"></p><p>Select the Global site tag (<code>gtag.js</code>) option and</p><p><img loading="lazy" src="/assets/images/5-608785d7a4cf17c4c93ce9c23ac88898.png" width="1012" height="555" class="img_ev3q"></p><p>copy the code.</p><p><img loading="lazy" src="/assets/images/6-53ec50e6cb53591c65576c098e60cb8d.png" width="852" height="534" class="img_ev3q"></p><p>Open your React project directory. For me, I created the app using create react app. Go to public &gt; index.html.</p><p><img loading="lazy" src="/assets/images/7-e19dc46035b62f5d31c98b344118b00f.png" width="391" height="499" class="img_ev3q"></p><p>Put the GA script tag inside the <code>&lt;head&gt;</code> tag. I am putting this as the last item of the head tag, after the site title.</p><p><img loading="lazy" src="/assets/images/8-0a1ce4039298b9bdece9f0ea4c00aac6.png" width="975" height="528" class="img_ev3q"></p><p>Build your project and publish. For me, I have set up my project in Netlify with GitHub CI. So every time I push the changes to my Github main branch, it will be deployed automatically.</p><p>Now visit your website from your browser or mobile device and verify that Google Analytics is registering the views. If you can see the views, that means you have successfully set up your analytics with the React app.</p><p><img loading="lazy" src="/assets/images/9-85cab2a6800f72173673afd997285710.png" width="1359" height="893" class="img_ev3q"></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-track-custom-events-in-reactjs-app">How To Track Custom Events in Reactjs App?<a href="#how-to-track-custom-events-in-reactjs-app" class="hash-link" aria-label="Direct link to How To Track Custom Events in Reactjs App?" title="Direct link to How To Track Custom Events in Reactjs App?">​</a></h2><p>If you want to track custom events you can use this npm package <a href="https://www.npmjs.com/package/ga-gtag" target="_blank" rel="noopener noreferrer">ga-gtag</a> which integrates Google Analytics 4 with your Reactjs application.</p><p>Recently I created a <a href="https://reactionpoll.com/" target="_blank" rel="noopener noreferrer">poll maker app</a> and I wanted to know how many people downloaded the polls using my app.</p><p>GA custom events come in handy for this type of tracking. <a href="https://developers.google.com/analytics/devguides/collection/gtagjs/events" target="_blank" rel="noopener noreferrer">Learn more about custom events from GA website</a>.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token function" style="color:rgb(220, 220, 170)">gtag</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'event'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'download_poll_image'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">poll_title</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'some value'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Previously we added the GA script tag into the head section of our index.html file, but we can’t use gtag inside our JS file because it’s not defined. This is where this handy package comes in.</p><p>Just install the package using npm install ga-gtag and import it into your project file where you will be tracking the event.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword module" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> </span><span class="token imports">gtag</span><span class="token plain"> </span><span class="token keyword module" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'ga-gtag'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Now since I want to track the image downloads, I will add this custom method inside my image download function.</p><p>This is how the gtag event function looks like:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">trackDownloadEvent</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token function" style="color:rgb(220, 220, 170)">gtag</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'event'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'download_poll_image'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token literal-property property">poll_title</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'some title'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>See I have named the event <code>download_poll_image</code> and inside I am tracking the <code>poll_title</code> parameter. This way, I will know how many times a new image has been downloaded and what were the titles of the polls that are generated.</p><p><img loading="lazy" src="/assets/images/10-897d58c2e2e323379dceacbcf6f02e97.png" width="509" height="555" class="img_ev3q"></p><div class="theme-admonition theme-admonition-tip alert alert--success admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>Side note</div><div class="admonitionContent_S0QG"><p>When I used this package to install the gtag instead of pasting the script tag, I was not receiving any data for new users. That’s why I decided to manually copy-paste the script tag and use this package just for tracking custom events.</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-see-the-custom-even-parameters-in-ga-dashboard">How to See the Custom Even Parameters in GA Dashboard?<a href="#how-to-see-the-custom-even-parameters-in-ga-dashboard" class="hash-link" aria-label="Direct link to How to See the Custom Even Parameters in GA Dashboard?" title="Direct link to How to See the Custom Even Parameters in GA Dashboard?">​</a></h2><p>One issue I ran into was, the custom event parameters don’t get saved in Google Analytics 4. So I can see all the <code>download_poll_image</code> events, but not the individual poll titles. I did some Googling and found that it will only show up on the real-time pane (not good).</p><p>So to make GA save these parameters, you have to mark that event as a conversion for it to store all the parameters you want:</p><p><img loading="lazy" src="/assets/images/11-fccd41f08be985ab080956471972caeb.png" width="1413" height="874" class="img_ev3q"></p><p>Now Analytics will keep them.</p><p>If you have come to the end of this post and it helped you with setting up Google Analytics with your React app, then please let me know by tweeting about it.</p><p>It tells me that I have done a good job and will inspire me to share more cool stuff in the future.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="key-takaways">Key Takaways:<a href="#key-takaways" class="hash-link" aria-label="Direct link to Key Takaways:" title="Direct link to Key Takaways:">​</a></h2><ul><li>Add Google Analytics tag simply by pasting into the head section of index.html page.</li><li>The react-ga npm package still doesn’t work with the new <code>G-XXXXX</code> tags.</li><li>Use gtag npm package to track custom events.</li><li>To persist the custom event parameters, you have to instruct GA.</li></ul><p>Since we are talking about React, check out <a href="/compress-images-reactjs">best practices of compressing images for React</a>.</p>]]></content:encoded>
            <category>reactjs</category>
            <category>google</category>
        </item>
        <item>
            <title><![CDATA[What is null in JavaScript?]]></title>
            <link>https://tamalweb.com/null-javascript</link>
            <guid>https://tamalweb.com/null-javascript</guid>
            <pubDate>Thu, 19 Mar 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[Every programming language has at least one bottom value but JavaScript has two: null and undefined (Crockford, 2017). We are going to focus on null for this article because there is so much that’s going on behind the scenes.]]></description>
            <content:encoded><![CDATA[<p>Every programming language has at least one bottom value but JavaScript has two: null and undefined (Crockford, 2017). We are going to focus on null for this article because there is so much that’s going on behind the scenes.</p><p><img loading="lazy" alt="null js" src="/assets/images/featured-3ab3044125d973c47e89cdbbe0f09d34.png" width="1200" height="630" class="img_ev3q"></p><p>What is null in JavaScript? <strong>null means no-value. When there is no value assigned to an object variable, it means the object doesn’t exist. If you want to delete the contents of an object from memory, you would assign that object to null.</strong></p><p>By the way, null is not exclusive to just JavaScript, I have seen it on Java, C#, SQL and it works the same way it does in JavaScript.</p><p>An object is a combination of primitive values like string, number, and boolean types. Since objects are special types of data, we also need a special concept of assigning no-values. This is where null comes in.</p><p>In this article, I will tell all about the null type and how it works in JavaScript and programming in general. But before I can fully explain to you about the null type, let me give you an overview of the types in JavaScript.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="primitive-types-and-reference-types">Primitive Types and Reference Types<a href="#primitive-types-and-reference-types" class="hash-link" aria-label="Direct link to Primitive Types and Reference Types" title="Direct link to Primitive Types and Reference Types">​</a></h2><p>A primitive type of data is a number and boolean. In JavaScript, the string data type is also considered a primitive type (spoilers: it’s actually not). This is because a string “Hello World” is actually a string of characters: ‘H’, ‘e’, ‘l’, ‘l’, ‘o’… and so on. A single character ‘T’ is a primitive type and the string is like an array of all these characters together.</p><p>This is why In Java (which is different than JavaScript), the String data type is actually an object. The same thing applies to JavaScript but JS is built in such a way that the string type is treated like primitive values.</p><p>So in short, it’s safe to say these are primitives in JavaScript: string, number, boolean.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> name </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Tamal'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> age </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">100</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> isMale </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token boolean">true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="so-what-are-primitive-types">So what are primitive types?<a href="#so-what-are-primitive-types" class="hash-link" aria-label="Direct link to So what are primitive types?" title="Direct link to So what are primitive types?">​</a></h3><p>A primitive type is where the variable actually holds the data.</p><p>If I open the variable age, I will find the exact value there.</p><p><code>age shows 100</code>
But watch what happens when I do the same for objects.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> person </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">name</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Tamal'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">age</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">100</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">isMale</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If I open the variable person, I will see this memory address and not the actual data.</p><p><code>person shows 0x000001</code></p><p>This is where primitive types and reference types differ.</p><p>As I mentioned earlier, an object is a custom data type made out of multiple primitive data types or even other objects.</p><p>An array is a collection of other primitive types like a list of names, or a list of numbers. So it’s an object too. When you check the type of an array, you will see object:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> list </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token number" style="color:rgb(181, 206, 168)">1</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">2</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">3</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">typeof</span><span class="token plain"> list</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// 'object'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Since each of the object is a custom type, a variable space is not enough to hold all the items and the configuration in it.</p><p>The solution: references.</p><p>The data items will be stored somewhere in the computer memory and the variable will only store the address to that memory location.</p><p>This variable will only reference to that memory location, thus it’s called a reference type (Sierra &amp; Berts, 2005).</p><p>But how this all relate to the null type?</p><p>Now that we know there are two types in JavaScript, we can set the initial starting values of the primitive types like this:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> name </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">''</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> age </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> isMale </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token boolean">false</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>But when it comes to objects, we can’t simply say person = {} because an empty object literal is still taking up memory somewhere and it’s not truly empty.</p><p>To fully erase the object from the memory, we will have to assign null to that object. But before you do that, let me tell you why doing this matters.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="referencing-a-reference-type-variable">Referencing a Reference type Variable<a href="#referencing-a-reference-type-variable" class="hash-link" aria-label="Direct link to Referencing a Reference type Variable" title="Direct link to Referencing a Reference type Variable">​</a></h2><p>Since the value of a primitive type lives inside the variable, it’s very easy to copy a variable.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> hero </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Superman'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> memberName </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> hero</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// change the value</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">memberName </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Batman'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// Check them:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// hero</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// &gt;&gt; "Superman"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// memberName</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// &gt;&gt; "Batman"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// But we can’t do the same thing with reference types.</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>If we try to do this and make changes to the second object, you will notice that the original object is also changing.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> person </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token literal-property property">name</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"Tamal"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token literal-property property">language</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"JavaScript"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">​</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> member </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> person</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// Now both objects have the same contents</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// And they are referencing to the same object</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">​</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// Making changes:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">member</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">name</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"Karen"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">member</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">language</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">"C#"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">​</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">person</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// {name: "Karen", language: "C#"}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// member</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// {name: "Karen", language: "C#"}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// So you can see two variables are referencing the same object.</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>This is why it’s important to know that the variable is actually holding the reference to the object. When you copy this variable, only the reference is being copied.</p><p>I am not going to cover how to copy objects because we are interested in the null value and how it comes into play.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="garbage-collection">Garbage Collection<a href="#garbage-collection" class="hash-link" aria-label="Direct link to Garbage Collection" title="Direct link to Garbage Collection">​</a></h3><p>All these variables take up some space in memory and there must be some way to free up the memory by doing some cleanups. When you are done with some objects, you can feel free to clean up that object so that the memory can be used for other things.</p><p>In high-level languages like in JavaScript, you don’t have to worry about this garbage collection, it happens automatically when the program stops using the variables (Sierra &amp; Berts, 2005).</p><p>You will notice that you can create an object in JavaScript but can’t delete it.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> person </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// there is no delete option</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>But you can with the null value.</p><p>When you assign null to a variable it will unlink the reference to the memory.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">person </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword null nil" style="color:rgb(86, 156, 214)">null</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// the object is deleted forever</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>The JavaScript (and Java) garbage collector is set up in such a way that whenever it finds an object that is not being referenced by any other variables, it will delete it.</p><p>So in a nutshell, the null value is used whenever you want to completely delete an object from the memory, and make sure no other variable is referencing that object.</p><p>Now that you know what null is and how it’s used, let me outline some interesting things about the null value in JavaScript.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="why-typeof-null-is-object">Why typeof null is object?<a href="#why-typeof-null-is-object" class="hash-link" aria-label="Direct link to Why typeof null is object?" title="Direct link to Why typeof null is object?">​</a></h3><p>When you check the type of null, you will see it’s an object. But null is not an object, it’s a primitive value. This is a bug in JavaScript and can’t be fixed (Crockford, 2017). On the other hand, null is only used for objects in JavaScript, so it’s useful if you adapt your program according to it.</p><p>typeof null</p><p>// "object"
// // this is a bug in JavaScript</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="is-null-and-undefined-the-same-in-javascript">Is null and undefined the same in JavaScript?<a href="#is-null-and-undefined-the-same-in-javascript" class="hash-link" aria-label="Direct link to Is null and undefined the same in JavaScript?" title="Direct link to Is null and undefined the same in JavaScript?">​</a></h3><p>null and undefined are not the same because null is a lack of value and undefined means the variable is not been assigned. In JavaScript, null is used for object types and undefined for string, number, boolean and other primitive types.</p><p>// loose equality
null == undefined</p><p>// true
// ​
// // strict equality
// null === undefined
// false</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-check-for-null-in-a-block">How to check for null in a block?<a href="#how-to-check-for-null-in-a-block" class="hash-link" aria-label="Direct link to How to check for null in a block?" title="Direct link to How to check for null in a block?">​</a></h3><p>// typeof person will return object and it will still return an object when set to null. To bypass this, you have to type this: person == null to check if the object exists or not.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">person </span><span class="token operator" style="color:rgb(212, 212, 212)">==</span><span class="token plain"> </span><span class="token keyword null nil" style="color:rgb(86, 156, 214)">null</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token comment" style="color:rgb(106, 153, 85)">// do something</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="key-takeaways">Key Takeaways<a href="#key-takeaways" class="hash-link" aria-label="Direct link to Key Takeaways" title="Direct link to Key Takeaways">​</a></h2><p>null is a primitive value that can be assigned to an object.
When you assign null to an object and no other variable is referencing to that object anymore, it will be deleted from the memory permanently.
In JavaScript, null is buggy and returns an object type when checked.
There are two bottom values in JavaScript, null and undefined, but they are not the same.
If this article helped you then feel free to leave a comment and let me know what you think.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="references">References:<a href="#references" class="hash-link" aria-label="Direct link to References:" title="Direct link to References:">​</a></h2><ol><li>Crockford, D. 2017. The Post JavaScript Apocalypse, ConFoo Developer Conference. Retrieved from <a href="https://youtu.be/NPB34lDZj3E?t=742" target="_blank" rel="noopener noreferrer">https://youtu.be/NPB34lDZj3E?t=742</a> (Timestamp: 12:22)</li><li>Sierra, K., Berts, B. 2005. Head First Java. Retrieved from <a href="https://www.amazon.com/Head-First-Java-Kathy-Sierra/dp/0596009208" target="_blank" rel="noopener noreferrer">https://www.amazon.com/Head-First-Java-Kathy-Sierra/dp/0596009208</a></li></ol>]]></content:encoded>
            <category>javascript</category>
        </item>
        <item>
            <title><![CDATA[What is Node JS? Explained in Simple Terms For Beginners]]></title>
            <link>https://tamalweb.com/what-is-nodejs</link>
            <guid>https://tamalweb.com/what-is-nodejs</guid>
            <pubDate>Thu, 27 Feb 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[Node JS is the first backend platform I learned and it helped me build full-stack applications. In this article, I will talk a little about Node and the concepts that go around this runtime environment. So to answer your question in simple terms,]]></description>
            <content:encoded><![CDATA[<p>Node JS is the first backend platform I learned and it helped me build full-stack applications. In this article, I will talk a little about Node and the concepts that go around this runtime environment. So to answer your question in simple terms,</p><p>What is Node JS? <strong>Node JS is a runtime environment for the JavaScript language similar to how you would use a Python interpreter to run Python code on your computer. Node JS is being used to run and execute JavaScript code in the server to build backend services.</strong></p><p>According to the official Node JS website, <em>“Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside of a browser”</em> (Node.js org, 2020).</p><p>Right out of the bat you must have figured it out what open-source and cross-platform means.</p><p><strong>Open-source</strong> means the source code of Node JS is open to the public (like Linux) and everyone can contribute, modify and use this software without paying any license fee. So if you make an application with Node JS, you won’t have to pay any money for the core Node JS runtime.</p><p><strong>Cross-platform</strong> means Node JS can run in all the major operating systems like Windows, Mac OS, Linux, and others so it doesn’t matter what kind of computer you own, it will still run. You can host a Node JS application in both Linux or Windows servers for deployment.</p><p>Now that the obvious is out of the way, I am going to explain the other important parts to help you understand what the Node runtime environment is and why you should care to use it. As part of the explanation, I am also going to outline other technical aspects of the runtime like the asynchronous, event-driven and non-blocking aspect of Node JS.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-the-node-js-runtime-environment">What is the Node JS runtime environment?<a href="#what-is-the-node-js-runtime-environment" class="hash-link" aria-label="Direct link to What is the Node JS runtime environment?" title="Direct link to What is the Node JS runtime environment?">​</a></h2><p>As mentioned before, Node JS is a runtime environment that will execute JavaScript code, but why is it so special?</p><p>Before the invention of Node JS, JavaScript language was only confined to the browser like in Google Chrome, Firefox, and Opera. Before Node, we could only run JavaScript in the browser to do little interactions and effects. It didn’t have any way to access the file system and that’s one reason why we don’t have any print command in JavaScript.</p><p>Node JS took the V8 engine (the JavaScript engine of Google Chrome) and turned that into a standalone JavaScript execution environment on the desktop.</p><p>So in a nutshell, the Node JS runtime environment allows you to run and execute JavaScript code outside of the browser environment. It allowed JS to read and write files and talk to the internet independently. This gave the opportunity to make web servers with Node JS and currently it’s a popular choice for making full-stack applications.</p><p>JavaScript language brought many new advantages to backend development with its new runtime environment. Here let me outline some of the technical features of the Node runtime environment that makes it different than others.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="asynchronous">Asynchronous<a href="#asynchronous" class="hash-link" aria-label="Direct link to Asynchronous" title="Direct link to Asynchronous">​</a></h3><p>“In a synchronous programming model, things happen one at a time” (Eloquent JavaScript, 2020, para. 4). Compared to that, in an Asynchronous model, multiple things can happen at the same time.</p><p>Node JS has one single thread to deal with the requests and another one as the main working thread.</p><p>When a user requests something, Node JS will send that request to the thread and get back to the main worker thread. If another user does another request, it will put the next request to the same thread and get back to working again.</p><p>After some time, the request will return and Node will be notified. Node will then take the response and give it to the user.</p><p>All this process can happen in one single thread one after another and this the gist of asynchronousness in Node JS.</p><p>In other programming environments such as Python and PHP, when someone makes a request, the entire thread gets blocked. If another user needs to make a new request, the system will have to create a new thread for the operation.</p><p>Node JS works with a single thread and can get notified for fulfilled requests via events. Let me explain what it means what event-driven means in Node JS.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="event-driven">Event-driven<a href="#event-driven" class="hash-link" aria-label="Direct link to Event-driven" title="Direct link to Event-driven">​</a></h3><p>Since Node JS is sending the request to another thread for completion, it has to know how something returns to it. Node JS will always keep listening to various events. This is similar to how operating systems work. An operating system will listen for various events like a mouse click, keyboard key press and so on. When an event comes, the system will stop what it was doing and put its attention to the event at hand and do what is required.</p><p>Similarly, in Node JS, it can do the assign tasks and still keep listening to other events. When a user clicks or something has returned from the thread, it will do what’s needed to do. This event-driven mechanism is what makes it possible for Node to work with a single thread and be super fast.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="non-blocking">Non-blocking<a href="#non-blocking" class="hash-link" aria-label="Direct link to Non-blocking" title="Direct link to Non-blocking">​</a></h3><p>Node JS does not sleep because it can do things one after another. It’s sort of like juggling where one item is always in the air. In Node’s case, it will juggle with one hand and keep all the other things in the air (other thread.)</p><p>When you make a request to save something to the database, you know it’s going to take some time to write. Node is going to move on to the next task at hand. This is the basics of JavaScript’s non-blocking computation model.</p><p>If you write this command in python: <code>sleep(5)</code></p><p>It’s going to literally sleep for five seconds and won’t be available to do anything within this time. This is an example of a blocking code. If you are making a server were 10,000s of users are making requests, this means for five seconds the server will not be able to serve these people.</p><p>One the other hand, this is an equivalent code in Node: setTimeout(doSomething, 5000);</p><p>Here Node will do that function after five seconds, but it will never go to sleep. This way it will still be able to handle all the other requests that come to it.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="node-package-manager-npm">Node Package Manager, NPM<a href="#node-package-manager-npm" class="hash-link" aria-label="Direct link to Node Package Manager, NPM" title="Direct link to Node Package Manager, NPM">​</a></h3><p>Node JS works with packages similar to how Java and Python has their own packages. NPM is a public repository where all the developers can contribute packages.</p><p>NPM comes built-in with Node JS and when you are building applications, you are going to use NPM commands to install and work with packages.</p><p>With this you will have to enter Linux like commands for installing various packages like this is how you would install the express js framework:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">npm install express</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="next-steps">Next steps<a href="#next-steps" class="hash-link" aria-label="Direct link to Next steps" title="Direct link to Next steps">​</a></h2><ul><li>Download Node JS and start using it</li><li>Start building something with it</li><li>Leave a comment in this post and let me know what you think</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="references">References:<a href="#references" class="hash-link" aria-label="Direct link to References:" title="Direct link to References:">​</a></h2><ol><li>Node.js. (2020). About Node JS. Retrieved February 27, 2020, from <a href="https://nodejs.org/en/about/" target="_blank" rel="noopener noreferrer">https://nodejs.org/en/about/</a></li><li>Eloquent JavaScript. 2020. Asynchronous Programming. Retrieved February 27, 2020, from <a href="https://eloquentjavascript.net/11_async.html" target="_blank" rel="noopener noreferrer">https://eloquentjavascript.net/11_async.html</a></li></ol>]]></content:encoded>
            <category>nodejs</category>
            <category>explainer</category>
        </item>
        <item>
            <title><![CDATA[Should I Learn JavaScript Before Learning Node JS?]]></title>
            <link>https://tamalweb.com/learn-javascript-before-nodejs</link>
            <guid>https://tamalweb.com/learn-javascript-before-nodejs</guid>
            <pubDate>Mon, 03 Feb 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[Today I am going to help you save time and hassle by giving you a concrete answer whether you should learn JavaScript before learning Node JS or not. You have learned about Node JS and would like to dive in to become a backend developer. Since you asked, this means you don’t know JS or have little experience with it. Allow me to simplify this for you.]]></description>
            <content:encoded><![CDATA[<p>Today I am going to help you save time and hassle by giving you a concrete answer whether you should learn JavaScript before learning Node JS or not. You have learned about Node JS and would like to dive in to become a backend developer. Since you asked, this means you don’t know JS or have little experience with it. Allow me to simplify this for you.</p><p>Should I learn JavaScript before Node JS? <strong>If you have taken another programming course before (like Python) then you have the proper programming foundation and can go ahead and start learning Node JS without taking a JavaScript course. You can pick up the fundamentals of JS while you build servers with Node. However, if this is the first time you are programming, then I would highly recommend you take a foundation web development course in HTML, CSS, and JavaScript to get your ABCs down.</strong></p><p>Other than general programming syntax in JavaScript, there is so much that goes into Node JS. When you are learning Node JS, you are most probably interested in learning how to build the backend services or the REST API of a website. For the rest of this article, I will discuss various programming and JavaScript concepts that go into when working with Node JS. You can check these skills and see if you already have these covered so you can make the right decision whether if you should learn JavaScript before Node or not.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="programming-fundamentals-to-master-before-learning-node-js">Programming fundamentals to master before learning Node JS<a href="#programming-fundamentals-to-master-before-learning-node-js" class="hash-link" aria-label="Direct link to Programming fundamentals to master before learning Node JS" title="Direct link to Programming fundamentals to master before learning Node JS">​</a></h2><p>These are some of the barebone programming fundamentals that every programmer must learn and master before they can take on building anything with code. These concepts are not exclusive to JavaScript and you will notice that you already know these if you have taken a programming course in another language such as Python, Ruby, PHP or Java.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="basic-data-types">Basic data types<a href="#basic-data-types" class="hash-link" aria-label="Direct link to Basic data types" title="Direct link to Basic data types">​</a></h3><p>These are your basic building blocks like strings, integers, and boolean data types. In programming, these are called primitive data types. You should be able to identify each of these data types and be able to assign them to variables. JavaScript has only a few primitive data types and they are String, Numbers (integers and floats) and boolean. In Node JS we make lots of variables and work with all sorts of data types throughout the application.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// Primitive data types in JavaScript</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> name </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Tamal'</span><span class="token plain"> </span><span class="token comment" style="color:rgb(106, 153, 85)">// String</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> age </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">100</span><span class="token plain"> </span><span class="token comment" style="color:rgb(106, 153, 85)">// Number</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> isAwesome </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token plain"> </span><span class="token comment" style="color:rgb(106, 153, 85)">// Boolean</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="control-flow">Control flow<a href="#control-flow" class="hash-link" aria-label="Direct link to Control flow" title="Direct link to Control flow">​</a></h3><p>In programming, if, else and else if are what makes the programs versatile. With the basic control flow structure, we make Node JS apps do various tasks depending on various conditions. Depending on the condition we can execute a command or do something else entirely.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// Control flow</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">isAwesome</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'Tamal is awesome!'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">else</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'Ouch!'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Other than if/else, Node JS also makes extensive use of the switch statement in various cases. So as a programmer you should know your control flow structure to excel in Node.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// Switch statement</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">switch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">color</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword" style="color:rgb(86, 156, 214)">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'RED'</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'Stop'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">break</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword" style="color:rgb(86, 156, 214)">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'GREEN'</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'GO'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">break</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword" style="color:rgb(86, 156, 214)">case</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'YELLOW'</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'WAIT'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">break</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword module" style="color:rgb(86, 156, 214)">default</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'DO NOTHING'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">break</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="loops">Loops<a href="#loops" class="hash-link" aria-label="Direct link to Loops" title="Direct link to Loops">​</a></h3><p>Loops like the for-loop, while-loop is what helps make repeating tasks in Node JS. Often times we use loops in a helper utility function. Other times we may use it to do a server action n number of times. As a programmer, you should know your loops really well to start learning Node JS.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// For loop</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">for</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> i </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">0</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"> i </span><span class="token operator" style="color:rgb(212, 212, 212)">&lt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">10</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"> i</span><span class="token operator" style="color:rgb(212, 212, 212)">++</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'I love you!'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// We used let instead of const because</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// we have to keep assigning a new number</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// to the i variable</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// While loop</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> i </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">while</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">i </span><span class="token operator" style="color:rgb(212, 212, 212)">&lt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">10</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'I hate you!'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  i</span><span class="token operator" style="color:rgb(212, 212, 212)">++</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// Do while loop</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> i </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">0</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">​</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">do</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">"Are we there yet?"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">i</span><span class="token operator" style="color:rgb(212, 212, 212)">++</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">while</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">i </span><span class="token operator" style="color:rgb(212, 212, 212)">&lt;</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">10</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="functions">Functions<a href="#functions" class="hash-link" aria-label="Direct link to Functions" title="Direct link to Functions">​</a></h3><p>Functions (subroutines or methods) are what Node JS servers are made of. In JavaScript, functions are first-class citizens, which means in JS, functions can take another function as a parameter or can return a new function as output. You should be able to build useful modular functions that can do a set of small tasks to return a value. In Node JS, everything is made out of little functions including the routes, APIs and middlewares.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// Functions</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">sumOfTwoNumbers</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">a</span><span class="token parameter punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token parameter"> b</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> result </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> a </span><span class="token operator" style="color:rgb(212, 212, 212)">+</span><span class="token plain"> b</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain"> result</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token function" style="color:rgb(220, 220, 170)">sumOfTwoNumbers</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token number" style="color:rgb(181, 206, 168)">2</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">3</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token comment" style="color:rgb(106, 153, 85)">// 5</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="advance-data-types-objects-and-arrays">Advance data types, Objects, and Arrays<a href="#advance-data-types-objects-and-arrays" class="hash-link" aria-label="Direct link to Advance data types, Objects, and Arrays" title="Direct link to Advance data types, Objects, and Arrays">​</a></h3><p>Objects are heavily used in modern JavaScript and in Node JS, objects are used everywhere. You should have a good idea of how object and array data type works. Objects are called dictionaries or maps in other programming languages. Just like objects, arrays are frequently used.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// Object literal in JavaScript</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> person </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">name</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Tamal'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">age</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">100</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">isAwesome</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">person</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">name</span><span class="token plain"> </span><span class="token comment" style="color:rgb(106, 153, 85)">// "Tamal"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Arrays are called lists in other languages. You should know the difference between primitive data types and reference data types such as objects and arrays and how to manipulate them.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// Arrays</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> fruits </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token string" style="color:rgb(206, 145, 120)">'apple'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'banana'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'mango'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">fruits</span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token number" style="color:rgb(181, 206, 168)">0</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token plain"> </span><span class="token comment" style="color:rgb(106, 153, 85)">// "apple"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="composing-basic-programs">Composing basic programs<a href="#composing-basic-programs" class="hash-link" aria-label="Direct link to Composing basic programs" title="Direct link to Composing basic programs">​</a></h3><p>After learning the programming syntax you should also know how to make basic programs. Programming is building stuff and you should be confident in constructing them. After taking a programming course you should practice on your own to make a few practice projects. Being able to build things is very important because, in Node JS, we have to build out a large complex application. A large complex application is nothing more than a combination of a lot of small programs put together so don’t underestimate the power of composing.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="fixing-bugs-finding-a-solution-online">Fixing bugs, finding a solution online<a href="#fixing-bugs-finding-a-solution-online" class="hash-link" aria-label="Direct link to Fixing bugs, finding a solution online" title="Direct link to Fixing bugs, finding a solution online">​</a></h3><p>When building the backend of a Node application, you will often run into problems. You should have an open mind to find these bugs and look for solutions online. Often times the issue can be solved with a quick Google search and finding a working piece of code in Stack Overflow. It’s completely okay to do this and professional software developers always Google and search for existing solutions and snippets of code. You should build the quality of not getting frustrated and always finding the solution to your coding problems.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="javascript-specific-concepts-that-are-heavily-used-in-node-js">JavaScript specific concepts that are heavily used in Node JS<a href="#javascript-specific-concepts-that-are-heavily-used-in-node-js" class="hash-link" aria-label="Direct link to JavaScript specific concepts that are heavily used in Node JS" title="Direct link to JavaScript specific concepts that are heavily used in Node JS">​</a></h2><p>At this point, you should be able to decide if you need to take a JavaScript course before taking on Node or not. If you do decide to take a JS course, I want you to double down on these particular skills because these are frequently used in Node JS. It’s possible to learn each of these individual things while you are learning Node JS. For that case, I would suggest you get a rough idea by reading the list below and work accordingly.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="callbacks">Callbacks<a href="#callbacks" class="hash-link" aria-label="Direct link to Callbacks" title="Direct link to Callbacks">​</a></h3><p>JavaScript is a functional programming language and the way the runtime works, it has the feature to have callbacks. In JS, you can supply another function as a function parameter. A callback is a function that will run at a certain point. You will often encounter functions that include another function that includes another function. If you want to work with Node JS and JavaScript in particular, you will be encountering a lot of callbacks.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// JavaScript can take a function as a parameter</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">doSomething</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">a</span><span class="token parameter punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token parameter"> b</span><span class="token parameter punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token parameter"> callback</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> result </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">callback</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">a</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> b</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain"> result</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token function" style="color:rgb(220, 220, 170)">doSomething</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token number" style="color:rgb(181, 206, 168)">2</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">2</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> sumOfTwoNumbers</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="promises">Promises<a href="#promises" class="hash-link" aria-label="Direct link to Promises" title="Direct link to Promises">​</a></h3><p>Promises are the modern version of callbacks and they do the same thing that callbacks do but their syntax is very easy to understand. Similar to callbacks, you can have one function do something and it will have another method attached to it when the first function completes the task. Under the hood, promises are doing the exact thing that callbacks do. In Node JS, you will encounter some modules that have callbacks and others have the new promises. As a Node developer, you should have a good grasp of both to make your life easier.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="let-and-const">let and const<a href="#let-and-const" class="hash-link" aria-label="Direct link to let and const" title="Direct link to let and const">​</a></h3><p>These are keywords for declaring variables in JavaScript. Apart from the var keyword, let and const lets you declare variables at the block scope. const is used to create constants, a value that stays the same. let is used to create variables that can be changed. You will find lots of tutorials and courses that make use of const &amp; let and explains to you what to use where. As long as you know what they do, you will be fine in building your server.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> city </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'London'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">city </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Berlin'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> country </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'France'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">country </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Greece'</span><span class="token plain"> </span><span class="token comment" style="color:rgb(106, 153, 85)">// Error, Can't do that</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="javascript-object-literals">JavaScript object literals<a href="#javascript-object-literals" class="hash-link" aria-label="Direct link to JavaScript object literals" title="Direct link to JavaScript object literals">​</a></h3><p>Objects are heavily used in Node JS application development. You should know the syntax and the shortcuts for working with them. In Node, objects are used for setting configurations for various NPM modules. Objects are also used for making data for your application. You should learn the modern ES6 syntax for object destructuring and prop name shortcuts.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// Object literal in JavaScript</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> person </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">name</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Tamal'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">age</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">100</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token literal-property property">isAwesome</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">person</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">name</span><span class="token plain"> </span><span class="token comment" style="color:rgb(106, 153, 85)">// "Tamal"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="anonymous-functions-and-arrow-functions-lambda">Anonymous functions and arrow functions (lambda)<a href="#anonymous-functions-and-arrow-functions-lambda" class="hash-link" aria-label="Direct link to Anonymous functions and arrow functions (lambda)" title="Direct link to Anonymous functions and arrow functions (lambda)">​</a></h3><p>Since JavaScript allows functions to be passed into various functions, you will often find anonymous functions used throughout the development. These are unnamed functions that you can use as an expression.</p><p>Another popular anonymous function format is the arrow function or lambda functions.</p><p>Arrow functions are similar to the ones found in Java and in C# and they did confuse me a lot when I was just starting out. When working with React JS or Node JS, you will find people often using arrow functions instead of regular functions, so it’s good to have an idea of how it works.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// Anonymous function</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">a</span><span class="token parameter punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token parameter"> b</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain"> a </span><span class="token operator" style="color:rgb(212, 212, 212)">+</span><span class="token plain"> b</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// shorthand for anonymous fn</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">a</span><span class="token parameter punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token parameter"> b</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain"> a </span><span class="token operator" style="color:rgb(212, 212, 212)">+</span><span class="token plain"> b</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// shorthand lambda</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">name</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> name</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// Used inside another function</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">fruits</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">map</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">item</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> item</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// .map() is a built in array method</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// which takes a function as a parameter</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h3 class="anchor anchorWithStickyNavbar_LWe7" id="functional-programming">Functional programming<a href="#functional-programming" class="hash-link" aria-label="Direct link to Functional programming" title="Direct link to Functional programming">​</a></h3><p>You will come across a lot of functional programming concepts while working with JavaScript and Node JS. If you are unfamiliar with this programming pattern it might seem a little odd at first. In functional programming, functions are treated as if they are regular data types. You can supply functions as arguments to other functions as mentioned earlier. You can also return functions as a return type from another function. Finally, one thing that you will see most often is assigning a function to a variable. You will find that often times anonymous or arrow functions are assigned to regular variables instead of declaring them. So be prepared to encounter all these functional tricks when working with Node JS.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="array-methods">Array methods<a href="#array-methods" class="hash-link" aria-label="Direct link to Array methods" title="Direct link to Array methods">​</a></h3><p>Some of the most common array methods are map, filter, reduce, and forEach. These functions allow developers to do quick array manipulations. Most JavaScript developers like to use array methods instead of the plain old for-loop. All of these methods accept a function as a parameter (arrow functions used most often) so be ready to see them in action.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="common-js-modules">Common JS modules<a href="#common-js-modules" class="hash-link" aria-label="Direct link to Common JS modules" title="Direct link to Common JS modules">​</a></h3><p>In modern JavaScript development, the code is split into multiple files and you have to explicitly import and export when you want to use the functionality. In React JS, you have import and export directives, however, as of writing this article, they are not fully supported in recent versions of Node JS yet. Node JS uses common JS modules for import-export. Node uses built-in global methods require for including JS files and module.exports for exporting functionality. These are not that difficult and once you use a few times you will get the hang of it.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// import export in JavaScript</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword module" style="color:rgb(86, 156, 214)">import</span><span class="token plain"> </span><span class="token imports maybe-class-name">React</span><span class="token plain"> </span><span class="token keyword module" style="color:rgb(86, 156, 214)">from</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'react'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword module" style="color:rgb(86, 156, 214)">export</span><span class="token plain"> </span><span class="token keyword module" style="color:rgb(86, 156, 214)">default</span><span class="token plain"> </span><span class="token maybe-class-name">MyComponent</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// equivalant in NodeJS context</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> express </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">require</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'express'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">module</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">exports</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> router</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="final-words">Final words<a href="#final-words" class="hash-link" aria-label="Direct link to Final words" title="Direct link to Final words">​</a></h2><p>Node JS opens the world of possibilities by using a single language JavaScript for both the front end and the back. With a solid foundation in programming concepts and JavaScript, you can be a pro in Node JS in no time. If you already have the foundation covered, I suggest you take on a Node course and learn JavaScript as you go. On the other side, if JS is your first language or you are out of touch for many years, then go and brush up the concepts mentioned in this article. Even if you do go out and spend extra time learning the ropes of JavaScript, the time will be spent well because it’s a great language to keep on your arsenal. That being said, here are some final tips I want to share with you.</p><ul><li>Get the programming basics down first, <a href="/resources">take a course</a> if you have to</li><li>Focus on the JavaScript specific concepts to have an easy time with Node</li><li>Build something! don’t worry, you will do just fine!</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments:<a href="#comments" class="hash-link" aria-label="Direct link to Comments:" title="Direct link to Comments:">​</a></h2><p><strong>Leo</strong>: I love your article, I already covered the basic js moving unto the intermediate and I study to be a full-stack js developer with react and node as my main target. Thanks again.</p><p><strong>Adale</strong>: I’ve been spinning my wheels looking at all these promises and courses online but very few take the time to explain things quickly and simply. I haven’t replied to a blog post in many years. I am so appreciative of what you do here. This site is a real resource. I will be taking your Udemy course recommendation.</p>]]></content:encoded>
            <category>nodejs</category>
            <category>javascript</category>
            <category>explainer</category>
        </item>
        <item>
            <title><![CDATA[Which Node JS Version Should I Use?]]></title>
            <link>https://tamalweb.com/which-nodejs-version</link>
            <guid>https://tamalweb.com/which-nodejs-version</guid>
            <pubDate>Thu, 30 Jan 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[Today I am going to help you pick the correct version of Node JS to use. When you are just getting started and about to download Node JS, you will be presented with 2 confusing versions to choose from. It’s not a big of a deal but for public service here’s my simple answer:]]></description>
            <content:encoded><![CDATA[<p>Today I am going to help you pick the correct version of Node JS to use. When you are just getting started and about to download Node JS, you will be presented with 2 confusing versions to choose from. It’s not a big of a deal but for public service here’s my simple answer:</p><p><img loading="lazy" alt="featured" src="/assets/images/featured-ced418fa9bf25acad29f59d327abccc8.png" width="1200" height="630" class="img_ev3q"></p><p>Which Node JS version to use? <strong>20 LTS. You should always use even-numbered versions marked LTS that says “Recommended for Most Users” on the download page. An even number Node version is 16.x.x LTS, 18.x.x LTS, 20.x.x LTS and so on that you should use when learning or deploying your project to a production environment.</strong></p><p>According to the Node JS blog, “If you are using Node.js in production use an LTS version. LTS release lines focus on stability, extended support and provide a reliable platform for applications of any scale. Most Node.js users and companies are on Long Term Support lines. For those that are currently using Node.js 4.x or Node.js 6.x, we recommend upgrading to Node.js 10” (Nodejs, 2018).</p><p>As I mentioned above, picking a Node version is not that of a big deal and you can always upgrade or downgrade versions when needed. If you are learning Node JS by following a tutorial, you can always check the version the instructor has used. You will be safe using a version that is higher than the version used by the instructor.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="update-node-20-improves-the-test-runner">Update: Node 20 improves the test runner<a href="#update-node-20-improves-the-test-runner" class="hash-link" aria-label="Direct link to Update: Node 20 improves the test runner" title="Direct link to Update: Node 20 improves the test runner">​</a></h3><p>The recent update to Node.js, version 20, includes an important change to the test_runner module. The module has been marked as stable after a recent update. </p><p>Now that you know which version to pick when working with Node JS, let me tell you a bit more about the Node version lifecycle.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-node-lts">What is Node LTS?<a href="#what-is-node-lts" class="hash-link" aria-label="Direct link to What is Node LTS?" title="Direct link to What is Node LTS?">​</a></h2><p>LTS stands for Long Term Support and the recommended version for most users. Nodejs org makes new versions frequently with new features, bug fixes, and performance optimizations. As a general rule, we can safely assume that the latest version is always the best version to use. A major node version increments the first number like this: 6.x.x, 7.x.x, 8.x.x, 9.x.x, where the leftmost number is the most significant one and the rest of the numbers are minor changes to the software like 14.15.0.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="major-versions-are-current-for-6-months">Major versions are current for 6 months<a href="#major-versions-are-current-for-6-months" class="hash-link" aria-label="Direct link to Major versions are current for 6 months" title="Direct link to Major versions are current for 6 months">​</a></h3><p>You will notice that in the Node download page you will find two versions, one marked as LTS and the other marked as Current. Instinctively you would want to download and start using the current version of the software. However, this version is not intended for you (the general user) but for the library authors.</p><p>Node JS has many uses. Nowadays Node is not only used by the backend developer but it’s also hugely used by the frontend tool developers. Various tools that make it easy to compile code such as Webpack, Gulp, Browserify, and others heavily rely on Node JS. Frontend frameworks like React, Angular, Vue, Svelte are also dependent on Nodejs. Testing frameworks like Jest, Mocha, and Enzyme also make use of the latest features of Node and NPM.</p><p>With a new major release of Node, it will allow these library owners 6 month time to download and make their tools compatible with new features and updates.</p><p>So in a nutshell, the current odd number Node JS versions such as 13.x.x, 15.x.x, 17.x.x and so on are targeted to the maintainers of various tools.</p><p>After 6 months, the odd numbered versions become unsupported, so there is no point in using these versions for development.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="node-lts-versions-are-good-for-30-months-2-years">Node LTS versions are good for 30 months (2+ years)<a href="#node-lts-versions-are-good-for-30-months-2-years" class="hash-link" aria-label="Direct link to Node LTS versions are good for 30 months (2+ years)" title="Direct link to Node LTS versions are good for 30 months (2+ years)">​</a></h3><p>After the first 6 months have passed and library vendors have enough time to test and implement new features into their tools, the even number versions (12.x.x, 14.x.x, and 16.x.x) will enter the LTS or Long Term Support phase. By the time you get access to an LTS version, you can rest assured that all of your favorite NPM tools are tested and supported by this version of Node.</p><p><img loading="lazy" alt="node version timeline" src="/assets/images/timeline-36dca5717112588e0e4755848453aec2.png" width="755" height="452" class="img_ev3q"></p><p>This LTS version will be further supported by the Open JS foundation for the next 30 months (2 and a half years). So if you are building a production application, you will get support for it for the next two years and more. The LTS version guarantees that the software will be maintained and critical bugs will be fixed during this period of time. The Node JS website states that “Production applications should only use Active LTS or Maintenance LTS releases” (Node JS org, 2020).</p><p>This all means that if today you start learning with Node JS 20, you are good to deploy a production app with this version till April 2026.</p><div class="theme-admonition theme-admonition-tip alert alert--success admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>tip</div><div class="admonitionContent_S0QG"><p>If today you start learning with Node JS 20, you are good to deploy a production app with this version till April 2026</p></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-goes-into-major-node-releases">What goes into major Node releases?<a href="#what-goes-into-major-node-releases" class="hash-link" aria-label="Direct link to What goes into major Node releases?" title="Direct link to What goes into major Node releases?">​</a></h2><p>New Node versions are all about speed, stability, feature updates and bug fixes. With each new version, Node JS is getting faster and better as the technology improves. For example, Node version 10 is 2x faster than Node version 6 (Nodejs blog, 2018), so it’s a good enough reason to always use the latest version. Since Node is built on other technologies, such as the V8 engine and the ECMA script, it has to stay current with new features and improvements.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="v8-engine">V8 Engine<a href="#v8-engine" class="hash-link" aria-label="Direct link to V8 Engine" title="Direct link to V8 Engine">​</a></h3><p>V8 is Google Chrome’s JavaScript engine and the engine that was used to run code in the Node JS runtime. With new updates of the V8 engine, it is important to bring the same level of code execution to Node JS. For this reason, the people at Node will implement new versions of V8 into the Node JS runtime.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="new-javascript-features">New JavaScript features<a href="#new-javascript-features" class="hash-link" aria-label="Direct link to New JavaScript features" title="Direct link to New JavaScript features">​</a></h3><p>As new JavaScript features come up every year, it is important to stay up to date with the current language features and implement them into the Node runtime. As you may know, you can’t use all the latest JS features in Node JS. With each new update to Node, it brings more and more new JavaScript features to the runtime environment.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="key-changes-in-major-node-versions">Key changes in major Node versions<a href="#key-changes-in-major-node-versions" class="hash-link" aria-label="Direct link to Key changes in major Node versions" title="Direct link to Key changes in major Node versions">​</a></h2><p>It’s clear that you should use the latest and greatest LTS version of the Node JS runtime, however, you will often come across old Node versions in apps or used in old tutorials. For that, it’s good to have an idea of some of the key aspects of major Node versions.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="node-6-implemented-es6">Node 6 implemented ES6<a href="#node-6-implemented-es6" class="hash-link" aria-label="Direct link to Node 6 implemented ES6" title="Direct link to Node 6 implemented ES6">​</a></h3><p>Perhaps the most important update for a JavaScript developer is to be able to use the modern ES6 version. Node 6 implemented the new ECMA Script 6 which is a significant improvement in JavaScript.</p><p>ES6 introduced keywords like let and const, arrow functions, destructuring, template literals and many more. In today’s web development, it sucks not to be able to code in ES6. So if you come across a Node tutorial, make sure it’s using version 6 and up.</p><p><img loading="lazy" src="/assets/images/1-fe80409cc08f37dbd94c933a294f30a5.jpg" width="600" height="338" class="img_ev3q"></p><p>In fact, 99% of the modern JavaScript features are now supported with Node version 6 and up (Node.green, 2020).</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="node-8-implemented-async-await">Node 8 implemented Async Await<a href="#node-8-implemented-async-await" class="hash-link" aria-label="Direct link to Node 8 implemented Async Await" title="Direct link to Node 8 implemented Async Await">​</a></h3><p>Async Await was implemented in Node 8 (Cyren, 2017). Async and Await are special keywords you can use in functions to make them wait for promises. It’s a simpler way to use the promises in your JS code.</p><p>Node 10 added promisified fs module
fs is a built-in module in Node for reading and writing to the file system. In the past, we had to use callbacks for working with the file system module but in Node 10, we get the option of promisified fs (Node blog, 2018).</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="node-12-implemented-es6-modules">Node 12 implemented ES6 modules<a href="#node-12-implemented-es6-modules" class="hash-link" aria-label="Direct link to Node 12 implemented ES6 modules" title="Direct link to Node 12 implemented ES6 modules">​</a></h3><p>If you worked with both React and Node, you will notice that in Node, you use the require method to include a module, while in React you use import to do the same. This is because Node JS is still behind when it comes to implementing the latest and greatest JavaScript features. Node 12 introduced experimental use of import and export modules (Node blog, 2019) and I am sure by the time you use Node 14 and up, it will be able to use it with no issues.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="node-18-adds-browswer-fetch-api">Node 18 adds Browswer fetch API<a href="#node-18-adds-browswer-fetch-api" class="hash-link" aria-label="Direct link to Node 18 adds Browswer fetch API" title="Direct link to Node 18 adds Browswer fetch API">​</a></h3><p>Node 18 version supports the addition of fetch API. This update further makes the syntax of browser JavaScript and Node.js uniformed. Here's how to use <code>fetch</code> in Node:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> res </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">await</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">fetch</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'https://nodejs.org/api/documentation.json'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">ok</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> data </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">await</span><span class="token plain"> res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">json</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">data</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Other than <code>fetch</code> it also exposes all the related Web API globals like <code>FormData</code>, <code>Headers</code>, <code>Request</code>, and <code>Response</code> (Nodejs, 2022).</p><p>If you would like to get your hands on trying out fetch, you can use NVM to install multiple versions of Node (explained later in this post).</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="can-i-install-multiple-node-versions-on-my-computer">Can I install multiple Node versions on my computer?<a href="#can-i-install-multiple-node-versions-on-my-computer" class="hash-link" aria-label="Direct link to Can I install multiple Node versions on my computer?" title="Direct link to Can I install multiple Node versions on my computer?">​</a></h2><p>Yes, <strong>you can use the NVM Node Version Manager app to install and use multiple versions of the Node JS runtime environment</strong>. NVM lets you easily switch between Node versions on the fly in your local development machine.</p><p>I was using the latest node version on my local computer then sometimes ago I was needed to use the old Node 8 version to run a particular project. I looked around and found NVM for windows.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-install-nvm-for-windows-computers">How to install NVM for Windows computers<a href="#how-to-install-nvm-for-windows-computers" class="hash-link" aria-label="Direct link to How to install NVM for Windows computers" title="Direct link to How to install NVM for Windows computers">​</a></h2><p>Go here to <a href="https://github.com/coreybutler/nvm-windows/releases" target="_blank" rel="noopener noreferrer">find the latest NVM for Windows</a> releases. This is a separate project that lets Windows users use Node version manager.</p><p>At the time of writing this article, this is the latest version (the version you see may be different) but you will see a similar page:</p><p><img loading="lazy" src="/assets/images/2-41632ef78e99e35d7e0b1a3023003b0c.png" width="800" height="727" class="img_ev3q"></p><p>Click on the <strong>nvm-setup.zip</strong> and download the zip file. Unzip the folder and install the program.</p><p>After that, go to your terminal (I use the built-in terminal in VS code)</p><p>Type in <code>nvm -v</code> to verify that NVM has been installed on your computer.</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWkAAACyCAMAAAC3K84kAAACc1BMVEUoKjY0N0YZGiG/nu4mJib29vSFwugoqNXyhsQoKqrVqDbBhDamKjbpwowohMOFKjYoKoym1vT26cNi6IT21qrB6fTn7pgxuHrW9vT29tViylQoKlcoKkXV9uh7f4s1KjZ+vItE3IRPoDbbvEnp1qooKlxZuEVi3GMofmO+ecQoTqkoKmjlX2g7KjYxKjZgcmfIozbq9vT29ujp9tU7yoTybYQ1VIA0N7DI7pjSTjZQNzbn4m8oKlTEjEZ+Kjbyepu+PTaDX7soPZudz5hZ6HBgRTam1ug0jMdDY4AooHDnz1xEfjaDKjbX9umLxen22LAoKoR7Y1ekbcM0N5Rgf4soo3/XrUadKja24pjqxZRDY4soKknE6vQoRXVuVEa2gTbq9tjV9tVP6IRE3HZ7cmdZ6ITn7n8ogW+rN0bB5vTp9ujq6sTShMT25sPyhLvShqlP6HpDKjbB6ejlhsTV6cPlhqnI7otc6Hp8f3QoN2c0rdjlhrvShru+ervlepvb7pjn7otucmc0N12LN0ZNN0a02OmLvOTB6dXpwsOFhMO+X7vq2LTVybPFdqmDPZs0UoNbe4BQcnli6HBP6HBW3GM0fmNuY1dsN0Y5KkXq9unW6unE6unExenp6ejV1uimqNWIvNSmhMPlesDVqKrleqnyc6mkM5Ddto/WrIiEKojlbYTSVoR7f4BgcoDb7n/I7n/SXnZEuHDb4m+DKmj26ejBwuiy1eT26tirrdjErcfBqMPk2LDpwqrBhKqFKqqkX6mDX6m2z5jBhIxEyoTEp4M1RXU7ynAxoHCkKmhuVGdPuGNgY1dDKldZuFRPuEVPoEVEfkUZmUe9AAAK0klEQVR42uzcZ1NTQRQG4LVEERMsYUABAUUjxhYdUFHQ2MUu9oa99957G3vvZey961jGD+rYuz/J95yb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nnEkorobTZUFoJpc2G0koobTaUVkJps6G0EkqbDaWVUNpsKK2E0mZDaSWUNhtKK6G02VBaCaXNhtJKjiU97JmzuKfzXENpLceWHvbtuwJbZ3DTr2c41k4SXmFv0GGkW3i68uNwM7pm9bgNldIvKb210190odxcy2gwuWF8Qo4qjT221dAylHpcYtoobrdV7VTRpXN7hMN0Efr+AIDXcg//Z8tLSQ/TxON1dGCtZzgBGEp3cUX8d2k0//iYSFHEON6hpvNtzxXxcH8jSk2b7eg5dXRpdaEM/IPm8NKYPQjNV5jOOpRWQmmzobQSSv9ph45JAABgIIj5d10FvxYOEgnJMj2YzjI9mM4yPZjOMj2YzjL95ACAnyTrKpvZowAAAABJRU5ErkJggg==" width="361" height="178" class="img_ev3q"></p><p>Type in <code>nvm list</code> to list all the node versions you have installed on your computer.</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYoAAACzCAMAAACgoqvzAAACalBMVEUoKjY0N0YZGiG/nu729vSFwujBhDYohMPVqDb21qooqNWm1vQoKqqmKjYoKoyFKjbB6fTpwoz26cPyhsTV9uj29tVi6ITW9vTn7pgxuHrp9tViylT29ugoKlcoKkV7f4s1KjZ+vItE3ITp1qpPoDbp9vTbvEnp9ugoKlxZuEVi3GMofmO+ecQoTqkoKmg1VIDlX2g7KjYxKjZgcmfIozY7yoTybYQ0N7DI7pjSTjZQNzbn4m8oKlTEjEZ+Kjbyepu+PTam1uiDX7soPZudz5hZ6HBgRTY0jMdDY4AooHDnz1xEfjaDKjbX9umLxenp6cP22LAoKoR7Y1c0N5Rgf4soo3/XrUadKjakbcS24pjqxZRDY4spRXUoKknE6vRuVEa2gTakKjbq9thP6IRE3HZ7cmfC6ulZ6ITn7n8ogW+rN0bB5vTlhMTShMT25sPyhLvShqlP6Hpd6HVDKjbV9tXCqcTlhLvlhqnI7otdd4B8f3QoN2dLNEnq9vS02Og0rdjShru+ervp2LPlepvb7pjn7otucmc0N11qY1eLN0aLvOTB6dXV6cO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hXEXupU5+WnjvSp1svM+K6AIuxJcIiTnlIhU5wKn4dSjfefkD1pDcfv0jZQ4cW7dhxCcyrosqJCSBMzVRYPa485xbIDRfUZab2Ca1EhEKWXnzpCpTkqsEXdpSOved2GXgEKLdmpsA+W3vwWydp77GiDtiElskhPegVg1bdQoIKn0nGvpvDLpz/c7hGhkkdxYqRHO6Qo5280spLN4XYCMUNvP/CB2744UIfnF5g4rWuxSWkmt6fiKgvTcneupH7pbFa12KTUwSqGAy/erDA3ZyPItaxsMVxO95HZ/xDuVKwm3Kn4bY+OBQAAAAAG+VtPo2MpxLiCcQXjCsYVjCsYVzCuYFzBuIJxBeMKxhWKAHxrU2oXkkpgAAAAAElFTkSuQmCC" width="394" height="179" class="img_ev3q"></p><p>At this point, it may show only one version of Node you have installed on your computer.</p><p>To install a different version of Node JS, you can type in <code>nvm install &lt;version_number&gt;</code> like: <code>nvm install 12.16.1</code></p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYMAAACJCAMAAAD5VqTyAAACalBMVEUoKjY0N0YZGiG/nu729vTyhsQohMP21qqFwuhi6ITBhDbn7pgxuHooKqqm1vRiylSmKjYoKlcoKkWFKjZ7f4soqNXVqDbpwoz26sQ1KjZ+vItE3ITp1qpPoDbbvElYuEUoKlxi3GMofmO+ecQoTqkoKmg1VIDlX2g7KjYxKjZgcmfIozbp9vTV9ujp9tUoKow7yoTybYQ0N7DI7pjSTjZQNzb29tbn4m8oKlTEjEZ+KjbV9vTyepu+PTaDX7soPZudz5hZ6HBgRTam1ug0jMdDY4AooHDnz1xEfjbB6fT29uiDKjbX9umLxen22LAoKoR7Y1ekbcM0N5Rgf4soo3/XrUadKjblhcHShcG24pjqxZRDY4spRXUoKknE6vRuVEa2gTakKjbq9thP6IR7cmfX9vRZ6ITn7n8ogW+rN0bB5vT25sPShqlP6Hp7f3lDKjbp9ujV9tXp6cPyhrvlhqnI7otE3Hpi6HQoN2fq9vTB6ei02Og0rdi+ervsd6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CLPeHiVWN/jEWMpoa9dS0IIIYQQQgghhBBCHnEDgI7gVlRYGzAAAAAASUVORK5CYII=" width="494" height="272" class="img_ev3q"></p><p>You can check out this page to see all the previous Node JS versions.</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAREAAADtCAMAAACvbbFqAAABFFBMVEXw8PD////MzMwzMzP//+zw8N7R///G8PD//9Hw8MaPz/+IxPDeqGrssW4zkdGw6f9usewzisan2/DRkTNqqN6naTOwbTPw26fGijP/6bCPM4+IM4je8PBuM4/s//+wbW6naWr/z4/wxIhqM4gzaaePMzMzbbAzM4iIMzOPM24zM4+IM2pqMzMzM2ozM25uMzNqaadubbBuM25qM2qwsY+nqIjw297R/+yPz+zG8N6IxN6MysynijOwkTP/6eywsW6nqGrs6f/e2/Cw6eyn295usbCwkbBqqKeniqfRz4+PkY/GxIiIioiwkW6PkW5ubW6nimqIimpqaWqPkTOIijPKq2ve5t5qisbMjmxukdHs6bDexIh8LQHLAAAKDElEQVR42uydB5PTMBCFE0RPLiQ4kNC50HvvvfdeB/7//2DfRsrGgsQmYwXf8N7gIlmWVp8lm5s5vWtQFEVRFEVRddSGHX3ZHdw+ndfuNZIKrTrn+pPkllPbG7XRhoMft88lMjozda19bJN2R/IsveW4kwOkZ+WItKRwP0/ELv7lE2k71/NhRQlopBmD0wgtFO/r3h3e+0ciV3qlx0gbteLy4NCmkNbejcZ1D/s4K0kElVQwRhAP6vNh5RK+bolLEr5byNcS/Zlj5PHB7UpkCJZ6eN0DWc9UK3CuNQ59jxLAFtLYFKk2jq0kEez8/VtOfdDGh7cwyABW4sU2OH/buZs7ikYeyoaw4gQeEbaGVIY9wGBrt2YS2T7qyU4LDqWg3CwH3D3qeSIj4f4ctVnvhzlCMiZbdnUBIsf7MolajeExPD4jovW2nebME56DDytOoBeeBSpRXsjEk3etGUQ27LiJnY7jGziAoNNppkQkYDmzMXEqTwRT9PDtlhZdkIhUiUgRMzYjghrxgNu9os9DCCuXGEq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ARpmNP/SmUEv1DUAv0BusBvbwkLl5973x5DFV5huAaR/GjAIt1FJ9A1aUSAN/7L7TREamRMKK9Jwq8g3AOcrbm7ZIS/MNsFnz48J+ZNismQA0VeYbgHEh9aNsSSBL8w2wNyv2aMXerJkvbqrONwB36pSXoepwqUhL9Q3ABOpgP/n6rmpb4XNh4ip5EYnMFX0DYvEnPRIhERIhkSaJxCKRxKJvAH0DKIqiKIqiqDUq+gYk9Q3QVce19A3AcsWwdHGIDIs1pW8A2pVjLX0DRD6j3cdlizWtbwDO6+kbYNg9JcSa3jcA+XX1DZiMfLkAwFo4vW+A5tfRN2C8Rt77BoC+xZrMN8CI1NE3YC+yozclYk3pG2Dc6+gbYPYJCBFjymJN6BsgJ3gf19I3QKvRpr/uQNA+Vq6Sp2+AF30DKIqiKIpaK1pH0TeAv1FDIiRCIjmRSCwSiUUisUgkFokkFn0DYqXwDdh8pLa+AVLGB6kLLc1IwJTAN6D0X8Vevm+ALWBGAnlmJGCq2Deg/F9O/ye+AbnxkE0A5lSxb4BdLdbyfQN+TZgZkUkgQSGMvjWZ2ucGgJUSGSL0PzdAzk4OlLtBApBr71kgBwkgA2qfG0BKrqH/uQFyCAFQkQ4OJPTYo8G5AUSXrPQ/N0AyElwDQAMEKgyyFgnQ4NwA6KX+hAH9zw2wC4XVFEBlIBVA4dFzA7CA0RDBC0bPDUAHoz290RAZDZHREBkNEcbREKE5AACPR65jb29NHQAAAABJRU5ErkJggg==" width="273" height="237" class="img_ev3q"></p><p>Once you have installed a new version using NVM, once again list them by typing <code>nvm list</code>.</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZ4AAADACAMAAAADUfUOAAACeVBMVEUoKjY0N0a/nu729vQZGiEohMOm1vT21qqFwujBhDaFKjamKjYoKqrpwowoqNX26cPVqDYoKozB6fTyhsT29tXW9vRi6ITV9ujp9tXn7pgxuHrq9vRiylT29ugoKlcoKkV7f4s1Kjbp1qp+vItE3IRPoDbp9ujbv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77rx6GYnHnRVWbTNUyTyyfGwUWi11EjwYlhnvQtT63FLPLqH5lvsW6z+JR5+cM17Wi3Niuzde0jHoraaJdTyP82dfQ+7WIzcJDikusDD07OzZhmGR8q+kZ2dFsIcBR5Da7VXb/o6uGm/wAwsVWU1QhJm5sdAx6k8LM+Xp868+FQQz9c1it0XfxO+HZdqUasc1KwXNDBbFMgA6VkHScbUsfQelmYDIh3y0EoOKXMHK6RmmTp9Zu495j5aVomHRWfH0BPJa7RgiBpJw/MgDF1i5p/LbHGO6Lh8EFEEt7RGnw/yV08jncavGNt1RGlv+HfNv/n3PiTDCDKeGEJGPx594u96pOtTe3dsgzAMhFEYKSJJQ0TDRFRsxRSMQMEKLIdzsnlFKgToInhfASKhOwzy/T6xsk/LZ3pubJP3r72969ZVne1ppV9tkiTp1zAWR/j1bEo5HZer/lfMjteHW9uFlMtOx+Wh49tTh2O0bdstp+OSzW2naKo3VKEUzem4dCM/KpSnLh6n43JFV3yMZUF5CBScjstDokLbmfLEk9NxueqxgIE5q6hLXTxOx6UbY39DHWomPJfN6ThJkiRJ0hct4zim5NDbqM5DHMepz37YYLreLU8W4jjOTMc1LlxsVKchjmMxxUPTD+YImYjjmMco5WJxWZ5ExHFMVpzLVF67awqXiDhucaSb8+ZGCUmWcRx53NQNax9e+QfLOK6sJ8sjSZIkSZIkSXrLA1siY2dq9j3RAAAAAElFTkSuQmCC" width="414" height="192" class="img_ev3q"></p><p>Now you can select a particular Node version by typing: <code>nvm use &lt;version&gt;</code> like I did <code>nvm use 8.9.4</code></p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAX8AAACECAMAAABPuNs7AAACglBMVEUoKjY0N0YZGiG/nu729vSFwugohMPVqDamKjYoqNWFKjbBhDb21qryhsT26cMoKowoKqrB6fTpwoym1vRi6ITn7pgxuHrW9vT29tViylTp9tUoKlcoKkV7f4vV9ug1KjZ+vItE3IRPoDbp9vTp1qrbvElYuEUoKlz29uhi3GMofmO+ecQ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24h9XitphQeZf4WJV8vnordawz3R3NbUAoqwrD9lq/KE489fqbkn816yH/Q/7HKmKY0VlEQPN4Ipd2lbY/zlc5a9q1D7SluTmgv3PSOSnB6s18PdvWUr+XhxeaKvgTxe0mZrptmL/8zfD/8NG4uv0W6mmws/a+XvLfryhCdLdFNuG+9+/GfFnQ/jr+R+s9R8X7/Kfk2zH/5/Zbzt0TAMAAMAwyL/radjbgAT8X/zH+L/4j/F/8R/j/+I/xv/Ff4z/i/8Y/xf/Mf4v/lsG7Dw6Zq8qXVMAAAAASUVORK5CYII=" width="383" height="132" class="img_ev3q"></p><p>Now type in <code>node -v</code> to verify that you are indeed using a different Node JS version:</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXoAAAB8CAMAAABQUIsLAAACZ1BMVEUoKjY0N0a/nu4ZGiH29vTyhsRi6ITVqDaFwujn7pgoqNUxuHpiylQohMMoKozBhDYoKlcoKkWFKjZ7f4umKjYoKqrpwow1KjZ+vItE3ITB6fT26sT21qpPoDbbvEnp1qooKlxZuEVi3GMofmO+ecQoTqkoKmjlX2g7KjYxKjbW9vRgcmfIozY7yoTybYQ1VICm1vQ0N7DI7pjSTjZQNzbn4m8oKlTEjEZ+Kjbyepu+PTaDX7soPZudz5hZ6HBgRTam1ug0jMdDY4AooHDnz1xEfjb29tWDKjbX9umLxen22LAoKoR7Y1ekbcM0N5Rgf4soo3/XrUadKjbV9ui24pjqxZRDY4spRXUoKknq9vTE6vRuVEa2gTb29unq9thP6IRE3HZ7cmdZ6ITn7n8ogW+rN0bB5vTV9tXShMT25sPyhLvShqnleqBP6HpDKjbp9tXq6sTlhsTlhqnI7ot8f3QoN2fp9ujB6eg0rdjShrvlhLu+ervp2LPb7pjn7otgeX1ucmc0N12LN0ZNN0a02OmLvOTB6dXV6cO+X7vFdqmDPZvWq4nfbYQ0UoNZ6Hpi6HBP6HBHuGw0fmNuY1dsN0Y5KkXq9unE6unExenp6ejV1uj29tj26temqNWIvN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lQ1mPQ//RNY3sSbXN8MPtu5fznroL+zvcLAaiR9Qz8TfEEK9qXMA5wF2NFQ/e2xSscNjkjjJF4hb6+nUu8L6hcYr7Kj1rO2GDRcNDlv19RJ7y49a43bt6VFAyn1QjwoCMvi1vkmqDLmxh3HqMYQzJZD1PHc21S/pfYpY1U69t69HH1v48phAd3RtNLGpqdUCB87GV+/lrtvX5/caZe0GB8ppHEXH5rq3w7HDmE5s8yFhMflLIH9/8FP/CagoJn0z8+/w/6hnKUGl+Xf4f9QLIYT4t8H/3DZfI1Oe1Eb8ety//E8t9X8amo+mixll/Z+HX2qRLmp80sXSRCJRdzLkzeafFOn4FRifByXqDuK7obh+uz9SH4nxy0TgE1MxemXWM0IcNp+QBtHhv0sXPwSzPKDeybSaM05IYpfq00TjFh5qR70SP0amGTd7xT5Tj7eg+ooR4qtPhx6XVIyairoS/MTeEnUjXtbj4KmH4jhw+R1sTcWPkXHisTyfZT02PqzztsZXRLanwzU2ftz26SL7g6SLgNhntd7ubGLvrwQsKVz32WWW8/10kf1RdJn8e6RRxRBCCCGEEL8Y75vpAk9QoiZIxYhu1vwW+Busf+edTdgPuk6394LU/1K8+2S4S2nvQwaH08SCT7PW6GHVL4WpTcdI87zZeI/Mv5XjDh4VY3pO+Kuh9hmZ2cDtsWBE8PLV46SQ+l8MpeJbee3TwDQfPwtpvi8WeDKup+O/GhpNE/WKO9PcB+P+9odgWvxC0txeDuus88x8fxPJQLjn5PqbkN8Cyzrcet9M7dTTs+1JvRBCCCGEEEIIIYQQQvyvvAPbk9i/nRMPcwAAAABJRU5ErkJggg==" width="378" height="124" class="img_ev3q"></p><p>You can also see that you are using a different NPM version that comes with that particular node installation:</p><p><img loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYIAAAB9CAMAAACYl5TDAAACUlBMVEUoKjY0N0YZGiG/nu729vTyhsSFwuhi6ITn7piEKjYohMMxuHrVqDZiylQoKlcoKkV7f4vBhDb21qooqNU1KjZ+vItE3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KI4pWIhJfy+AkCr3qUASxvfPVCyZgHd9lpoBRIUIPyyi/8xBag5x7tYSRUgG2wFTtJg8zZ2ZAv5YwqwmlHVfzILMCUmx6g/pSCw9GzNpFmAw5JKrgDETi+TzfjPKAh6gKUSFWA4pFIrCHSRzfiPZUHQSnpQkjKTOQXekChISsYUAFGQFvlN6b+CKGBHFLAjCtgRBeykVuD1gAJfD5T3f/WJjrwJy2EF3wQ4hvi7D6chvBGWA2omFQSWOgbs76mPye9EM6nAe7umu/J4LapM8vFYju8FlqsOjSpKlcdREPTgUzP5cCYHFZiCbzkKQuZiMBkQlCzIaQVY666mUeDeC7yyF+S0AlN4gh7LfDBPDxrE2seZ1MJDTkQ5qYA+m0H5txXgyfSNAnIgf+gl747/EUQBO6KAHVHAjihgRxSwIwrYEQXsiAJ2RAE7ooAdUcCOKGBHFLAjCtgRBdx8BgueznuGfQ7BAAAAAElFTkSuQmCC" width="386" height="125" class="img_ev3q"></p><p>Now you can use a specific version that is required in your project.</p><p>Did you know about NVM? Tweet this to your followers and let them know,</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="final-words">Final Words<a href="#final-words" class="hash-link" aria-label="Direct link to Final Words" title="Direct link to Final Words">​</a></h2><p>Node JS has two different audiences, the regular developers (us) and the open-source contributors (library authors). And for this reason, Node offers two different versions on their download page. For most cases, it’s safe to just go with the latest LTS version of the Node and if you are following a tutorial, just ask your instructor which version you should be using. Now that it’s the end of this article, here are a few things I want you to do:</p><ul><li>Download the latest 16.x.x LTS version of Node</li><li>Start building something</li><li>Check out the <a href="/resources">resources page</a> if you want to learn more about Node</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="references">References<a href="#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References">​</a></h2><ol><li>Node.js. (2020). Node Releases. Retrieved January 30, 2020, from <a href="https://nodejs.org/en/about/releases/" target="_blank" rel="noopener noreferrer">https://nodejs.org/en/about/releases/</a></li><li>Node.green (2020). Node.js ES2015 Support. Retrieved January 30, 2020, from <a href="https://node.green/" target="_blank" rel="noopener noreferrer">https://node.green/</a></li><li>Cyren, T. (2017). 5 Fantastic Features Shipping with Node.js 8 LTS. Retrieved January 30, 2020, from <a href="https://nodesource.com/blog/five-fantastic-features-shipping-with-node-js-8-lts-carbon" target="_blank" rel="noopener noreferrer">https://nodesource.com/blog/five-fantastic-features-shipping-with-node-js-8-lts-carbon</a></li><li>Node.js. (2018). October Brings Node.js 10.x to LTS and Node.js 11 to Current! Retrieved January 30, 2020, from <a href="https://medium.com/@nodejs/october-brings-node-js-10-x-to-lts-and-node-js-11-to-current-ae19f8f12b51" target="_blank" rel="noopener noreferrer">https://medium.com/@nodejs/october-brings-node-js-10-x-to-lts-and-node-js-11-to-current-ae19f8f12b51</a></li><li>Node.js. (2019). Announcing core Node.js support for ECMAScript modules. Retrieved January 30, 2020, from <a href="https://medium.com/@nodejs/announcing-core-node-js-support-for-ecmascript-modules-c5d6dc29b663" target="_blank" rel="noopener noreferrer">https://medium.com/@nodejs/announcing-core-node-js-support-for-ecmascript-modules-c5d6dc29b663</a></li><li>Node.js. (2022). Node.js 18 is now available!. Retrieved April 20, 2022, from <a href="https://nodejs.org/en/blog/announcements/v18-release-announce/" target="_blank" rel="noopener noreferrer">https://nodejs.org/en/blog/announcements/v18-release-announce/</a></li></ol>]]></content:encoded>
            <category>nodejs</category>
        </item>
        <item>
            <title><![CDATA[Why Express JS is Used in Node JS?]]></title>
            <link>https://tamalweb.com/why-expressjs-in-nodejs</link>
            <guid>https://tamalweb.com/why-expressjs-in-nodejs</guid>
            <pubDate>Wed, 29 Jan 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[Whenever you go out and try to learn how to configure a web server with Node JS, you will see that the first thing the instructor does is to install Express. Just like you, I always wondered why most people use Express JS and is there another way to build a server without it?]]></description>
            <content:encoded><![CDATA[<p>Whenever you go out and try to learn how to configure a web server with Node JS, you will see that the first thing the instructor does is to install Express. Just like you, I always wondered why most people use Express JS and is there another way to build a server without it?</p><p>Why Express JS is used in Node JS? <strong>Express JS is a minimal framework for building web applications in Node JS. It makes the process of creating a server simple with built-in methods that’s why Express JS is widely used and is the de facto framework for Node.</strong></p><p>Express JS is one framework that rules Node JS development. Express is also a central component for the MEAN stack development (MongoDB, Express, Angular, and Node).</p><p>Before Express, it was hard and cumbersome to build out a web server with Node but now you can install Express and run a server within a few lines of codes.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-does-express-js-do-in-node-js-development">What does Express JS do in Node JS development?<a href="#what-does-express-js-do-in-node-js-development" class="hash-link" aria-label="Direct link to What does Express JS do in Node JS development?" title="Direct link to What does Express JS do in Node JS development?">​</a></h2><p>We know that we can use Node JS to build a backend server. Node provides an http module that you can use to check for routes, parse the payloads and supply content. But as you start building multiple routes, this becomes repetitive and a complicated process. Express JS simplifies the process by providing effective route creation and support for middlewares. It gives you all the tools you will need for route creation, parse payloads, create HTML view pages, work with middleware functions and connect to databases.</p><p>So in a nutshell, Express JS is used to build out web applications with Node JS. Why it’s used and instead of other frameworks? Because this is the one framework that 93% of the JavaScript developers like to use (State of JavaScript, 2019).</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-are-middlewares-in-express-js">What are middlewares in Express JS?<a href="#what-are-middlewares-in-express-js" class="hash-link" aria-label="Direct link to What are middlewares in Express JS?" title="Direct link to What are middlewares in Express JS?">​</a></h2><p>The Express framework works by making use of middlewares. Every route you create with Express JS will have the option to supply a middleware. Middleware is like a simple function that can do a certain task. Let’s say I create a middleware called validateEmail to check if the given email is a valid email address or not. I can pass this middleware into the route and when it reaches that part, it will run the function for validating email addresses. With middle-wares, you can make modular code that you can reuse all over your application that makes it easy for development.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="can-i-build-a-web-server-with-plain-node-js-without-a-framework">Can I build a web server with plain Node JS without a framework?<a href="#can-i-build-a-web-server-with-plain-node-js-without-a-framework" class="hash-link" aria-label="Direct link to Can I build a web server with plain Node JS without a framework?" title="Direct link to Can I build a web server with plain Node JS without a framework?">​</a></h2><p>Yes, you can build a web server using only the built-in Node modules without using any frameworks. In fact, people used to build servers using the built-in http and https modules before Express came along. After learning how to build a full-stack web application with Node, I got interested to learn how I can build a server with vanilla Node. The process is a bit complicated and I soon realized how easy Express makes to build a server. If you are interested to learn how to build a server with the built-in modules, you can check out this course from Pirple.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="does-express-js-come-built-in-with-node-js">Does Express JS come built-in with Node JS?<a href="#does-express-js-come-built-in-with-node-js" class="hash-link" aria-label="Direct link to Does Express JS come built-in with Node JS?" title="Direct link to Does Express JS come built-in with Node JS?">​</a></h2><p>Although Express JS is a hugely popular framework for Node, it does not comes built-in with Node JS. To use this framework you will have to install express via NPM in your node project.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="why-javascript-developers-love-express-js">Why JavaScript developers love Express JS?<a href="#why-javascript-developers-love-express-js" class="hash-link" aria-label="Direct link to Why JavaScript developers love Express JS?" title="Direct link to Why JavaScript developers love Express JS?">​</a></h2><p>As mentioned previously that over 93% of the JavaScript developers are satisfied using the Express framework and would love to keep using it. Other than developer satisfaction, there are some other concrete reasons for using this framework. One big reason for using Express is that the framework is minimal and unopinionated. By this, it means, that with Express you can structure the app any way you want. Let me share what I mean by this.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="express-js-is-minimal-and-unopinionated">Express JS is minimal and unopinionated<a href="#express-js-is-minimal-and-unopinionated" class="hash-link" aria-label="Direct link to Express JS is minimal and unopinionated" title="Direct link to Express JS is minimal and unopinionated">​</a></h3><p>According to the official Express JS homepage, it’s a “Fast, unopinionated, minimalist web framework for Node.js” (ExpressJS, 2020). Express uses less overhead in the core framework so that makes it minimal and a good choice for building out large web applications. You don’t want to have a framework that fills your codebase with lots of bloatware that you are never gonna use. With minimal code, the framework will not slow down your entire application.</p><p>Express JS is fast because of minimal footprint, but it also helps you build a server quickly. With a few lines of code, you can create a simple web server. With some more lines, you can create routes. When I went to create a server using the core Node modules, I realized how long and how many lines of code and logic it takes just to serve a “Hello World” page. This made me realize how quick and easy it is to build a server with a simple Express JS module.</p><p>Express is unopinionated and does not dictate you on how to structure your web applications. With Express you can structure your app any way you want; connect to any type of databases like MySQL, MongoDB or PostgreSQL; pick and use the view engine that you like the most such as pug, ejs, handlebars, mustache and many more.</p><p>When you have a specific need to fulfill you can pick another framework that best suits your needs. But did you know that other popular frameworks are actually built with Express?</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="other-frameworks-are-built-on-express-js">Other frameworks are built on Express JS<a href="#other-frameworks-are-built-on-express-js" class="hash-link" aria-label="Direct link to Other frameworks are built on Express JS" title="Direct link to Other frameworks are built on Express JS">​</a></h3><p>There are dozens of frameworks out there in the JavaScript ecosystem (Node.js Frameworks, 2020) and you know what, almost all of them are built on top of the core Express JS framework. Popular frameworks such as NestJS, Sails, Feathers JS, Loopback, and Graphql-yoga are among the few that are built using Express (ExpressJS, 2020). Another alternative framework to Node is Koa JS that is created by the same people who created Express JS. This shows the dominance of one single framework in the Node ecosystem.</p><p>If you are just getting started with Node and you don’t know where to start, you can safely pick Express JS. Then when you are leveling up and know what exactly you need, you can pick up other frameworks.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="companies-using-express-js">Companies using Express JS<a href="#companies-using-express-js" class="hash-link" aria-label="Direct link to Companies using Express JS" title="Direct link to Companies using Express JS">​</a></h3><p>Of the top 10,000 websites on the internet, about 942 (9.42%) of the websites use Express JS (BuiltWith, 2020). This includes sites and services like PayPal, Glassdoor, Windows, Accenture, IBM, FOX Sports, Myntra, Uber, Yandex and many more (ExpressJS, 2020). Large companies using Express in their production application is a good enough reason to choose the Express framework and one of the dominating factors why people use it.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="conclusion">Conclusion<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion">​</a></h2><p>Express JS makes it super simple to build routes, connect to the database, work with middlewares and serve dynamic HTML pages to build out web servers. It’s a fantastic tool that can speed up your Node development when you are just starting out. So I suggest you go ahead and give Express a try. Here are some steps to help you along the way,</p><p>Take a look at the Express JS documentation
Build a Node server using Express JS
Leave a comment on this post and let me know what you are going to build</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="references">References<a href="#references" class="hash-link" aria-label="Direct link to References" title="Direct link to References">​</a></h2><ol><li>Express Usage Statistics. BuiltWith.com (2020). Retrieved January 29, 2020, from <a href="https://trends.builtwith.com/framework/Express" target="_blank" rel="noopener noreferrer">https://trends.builtwith.com/framework/Express</a></li><li>Companies using Express in production. Expressjs.com (2020). Retrieved January 29, 2020, from <a href="https://expressjs.com/en/resources/companies-using-express.html" target="_blank" rel="noopener noreferrer">https://expressjs.com/en/resources/companies-using-express.html</a></li><li>Frameworks built on Express. Expressjs.com (2020). Retrieved January 29, 2020, from <a href="https://expressjs.com/en/resources/frameworks.html" target="_blank" rel="noopener noreferrer">https://expressjs.com/en/resources/frameworks.html</a></li><li>The State of JavaScript: Backend Frameworks. State of JS (2019). Retrieved January 29, 2020, <a href="https://2019.stateofjs.com/back-end/" target="_blank" rel="noopener noreferrer">https://2019.stateofjs.com/back-end/</a></li><li>Node.js Frameworks. (2020). Retrieved January 29, 2020, from <a href="http://nodeframework.com/" target="_blank" rel="noopener noreferrer">http://nodeframework.com/</a></li></ol>]]></content:encoded>
            <category>nodejs</category>
            <category>explainer</category>
        </item>
        <item>
            <title><![CDATA[How Much Time Does it Take to Learn Node JS for Beginners?]]></title>
            <link>https://tamalweb.com/how-much-time-nodejs</link>
            <guid>https://tamalweb.com/how-much-time-nodejs</guid>
            <pubDate>Tue, 28 Jan 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[You are just getting started with web development and wondering how much time it takes to learn Node JS to be able to build something, like a social network, a chat application, or a SaaS to put it out there. Or maybe you are just wondering what are the skills you will need to become job-ready within a few months time. Well, my friend, you are in luck because today I am going to tell you exactly how long it takes to become a full-stack developer using Node JS sharing my own learning experience.]]></description>
            <content:encoded><![CDATA[<p>You are just getting started with web development and wondering how much time it takes to learn Node JS to be able to build something, like a social network, a chat application, or a SaaS to put it out there. Or maybe you are just wondering what are the skills you will need to become job-ready within a few months time. Well, my friend, you are in luck because today I am going to tell you exactly how long it takes to become a full-stack developer using Node JS sharing my own learning experience.</p><p>How much time does it take to learn Node JS? <strong>It takes around 3 months to fully learn Node JS and be able to build a functional full-stack application. If you already know some other programming, you can get the basics down within a few week’s time.</strong></p><p>This is because there are so many moving parts that go into building a working app such as a social network. It took me a similar amount of time by following a video course that took me from a beginner to a pro in deploying web applications.</p><p>Of course, the actual time to learn anything solely depends on your personality, how much time you have available to commit to learning, and what kind of skills you already have that you can take advantage of.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="my-skill-level-when-i-started-learning-node-js">My skill level when I started learning Node JS<a href="#my-skill-level-when-i-started-learning-node-js" class="hash-link" aria-label="Direct link to My skill level when I started learning Node JS" title="Direct link to My skill level when I started learning Node JS">​</a></h2><p>I started learning Node JS while having good web development skills in HTML and CSS. I didn’t have any prior JavaScript skills, other than taking a programming fundamental course many years ago. When I was taking the Node course, <strong>I had no experience working with JavaScript and how backend development works</strong>. So when I was learning Node, I was also learning backend development and JavaScript at the same time. It’s completely fine to learn JavaScript while you are learning Node JS.</p><p>I am going to assume you have a similar skill level that I had when I started learning Node and will write the rest of this article according to it.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="this-much-time-i-spent-everyday-learning-node">This much time I spent everyday learning Node<a href="#this-much-time-i-spent-everyday-learning-node" class="hash-link" aria-label="Direct link to This much time I spent everyday learning Node" title="Direct link to This much time I spent everyday learning Node">​</a></h2><p>When I was learning Node JS backend development, I dropped everything that I was doing previously. As a freelancer, I didn’t have any job or study during that time so I put all my focus and effort into learning this new skill. I was watching videos and writing code all the time during the day. I recall that <strong>I was spending roughly 4 focus hours in front of my computer every day for my Node learning</strong>. This time includes watching the video lessons, taking notes and then redoing what my instructor was doing.</p><p><strong>To be honest, it was frustrating at times and I don’t recommend anyone to rigorously learn something like the way I did</strong>. I wanted to learn Node JS as fast as I can so I took this painful route. As it turns out, it still took me 3 months to complete the entire paid course from Wes Bos.</p><p>The entire Node course that I took was only 10 hours in length, but it takes way more than that to fully understand and then implement each of the concepts.</p><div class="theme-admonition theme-admonition-warning alert alert--danger admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"></path></svg></span>A word on courses</div><div class="admonitionContent_S0QG"><p>Previously I adviced people to finish the entire course that you are taking no mater how long it takes, but it's only going to make you miserable, just like it made me. Instead pick out the parts of the course you are interested in and mix and match your learning.</p></div></div><p>Prior to learning Node JS, I was a serial quitter. I took so many programming courses and failed to complete them so many times. So this time I was determined to finish what I started. But after I went through the pain, I had great results to show to the world.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-i-was-able-to-build-after-learning-node-js">What I was able to build after learning Node JS<a href="#what-i-was-able-to-build-after-learning-node-js" class="hash-link" aria-label="Direct link to What I was able to build after learning Node JS" title="Direct link to What I was able to build after learning Node JS">​</a></h2><p>The course that I took taught me how to build a product listing site. This included user registration, logging in, posting user-generated content, and build REST API for favorites. I would make a new project from scratch the build out every feature I learned so far.</p><p>This is my node practice folder. Almost half of the projects I built during my initial three-month learning period.</p><p><img loading="lazy" src="/assets/images/1-62db718f1cbd5f210ad1dde7893fa011.png" width="606" height="631" class="img_ev3q"></p><p>I made practice projects that look like these:</p><p><img loading="lazy" src="/assets/images/2-31bfb32c2e71164e631fdcb5d81f0dcb.jpg" width="913" height="633" class="img_ev3q">
<img loading="lazy" src="/assets/images/3-e10d7bd944a9efb382916b552ce9a189.jpg" width="924" height="654" class="img_ev3q">
<img loading="lazy" src="/assets/images/4-ea8fb36eefd3d98d16034fafcc5ef28d.jpg" width="940" height="552" class="img_ev3q">
<img loading="lazy" src="/assets/images/5-15f5754b9c972e83a24a914d3b8e3bad.jpg" width="943" height="450" class="img_ev3q"></p><p>As you can see, most of these practice projects were more geared towards social media sites, because that’s what I wanted to build. My first real project was building a Twitter clone out of my existing Node skills.</p><p><img loading="lazy" src="/assets/images/6-ea64ddcf633fa8090320e5522531c134.jpg" width="1197" height="898" class="img_ev3q">
<img loading="lazy" src="/assets/images/7-083b07fa2920556d6e382b123dd0db7a.jpg" width="1000" height="750" class="img_ev3q"></p><p>Twitter Clone
This was a fun project to do since I also learned how to deploy the project on the internet, and I quickly deployed it onto a free Heroku service to show it to the world.</p><p>After that, I kept on building other projects like the Reddit clone, APIs, and many client projects. It was great to see my hard work finally paid off and bringing fruits of my labor. I also started getting many job inquiries from many different companies for interviews (because I was sharing my work on the internet). I even got a job offer later that year (which I declined.)</p><p>Most of all, I was happy that this time I did not quit and now I have a valuable skill that allows me to build full-stack applications. If you are pumped up reading my Node journey, now let me give you some tips on how to learn Node JS efficiently.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="an-efficient-strategy-for-quickly-learning-node-js">An efficient strategy for quickly learning Node JS<a href="#an-efficient-strategy-for-quickly-learning-node-js" class="hash-link" aria-label="Direct link to An efficient strategy for quickly learning Node JS" title="Direct link to An efficient strategy for quickly learning Node JS">​</a></h2><p>Node is a huge topic and there is a lot to cover. You can spend years and years learning about it and will still feel you haven’t learned it enough. This is why you have to be smart with your learning goals. Instead of learning everything, there is about Node JS, take a small portion, and be the best at it.</p><p>I had the goal to learn how to build a full-stack application with Node so that I can make social networks. I think you should also follow this path and learn how to quickly build a similar project. The fastest way to build a Node server is by using a framework called Express JS.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="use-express-js-to-build-your-node-server">Use Express JS to build your Node server<a href="#use-express-js-to-build-your-node-server" class="hash-link" aria-label="Direct link to Use Express JS to build your Node server" title="Direct link to Use Express JS to build your Node server">​</a></h3><p>Express JS is the simplest and the most popular framework for building a server application with Node JS. With this framework, you can get a server up and running within a few lines of code. Basically express is a yet another custom module you will install in your application and use all the methods provided by it. When working with Node JS, you will find that you are installing custom NPM modules for doing almost everything. It is common in the JavaScript ecosystem to use other people’s code. In this case, these codes are bundled in NPM modules.</p><p>Express has many methods that allow you to create routes, controllers, set the view engines, connect to the database and many more built-in configuration that makes it easier for you to set up a server. You can even use an express-generator to start a project with boilerplate code. Building a server is simply creating routes that can handle various HTTP methods.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="master-the-basic-http-methods">Master the basic HTTP methods<a href="#master-the-basic-http-methods" class="hash-link" aria-label="Direct link to Master the basic HTTP methods" title="Direct link to Master the basic HTTP methods">​</a></h3><p>When you are building a server, all you have to do is to create a few routes to handle some HTTP methods. The frontend of your application will talk to your server using these routes and the methods. Let’s say you have a home page that will list all the tweets posted by all the users. The frontend will request to GET all the tweets to the /all route in the server. The server will then load up all the tweets at that handler and send it to the frontend for displaying.</p><p>Similarly, you may have a textbox on your frontend that will send a POST request whenever someone posts a new tweet. The frontend will send that POST request to the /post handler in the server, that the server will respond to accordingly.</p><p>With backend building you are going to make routes that handle GET, POST, PUT, DELETE and other HTTP requests for making basic CRUD operations(Create, Read, Update, and Delete). If you can learn the gist of how these methods work, you will be set for 80% of the work required in Node. In fact, these are common among every other backend server programming.</p><p>Here’s a tip: You can build the entirety of your server by using just the GET and POST methods.</p><p>But above all, you should not worry about memorizing all the little things.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="you-dont-have-to-memorize-everything">You don’t have to memorize everything<a href="#you-dont-have-to-memorize-everything" class="hash-link" aria-label="Direct link to You don’t have to memorize everything" title="Direct link to You don’t have to memorize everything">​</a></h3><p>Node JS backend development is all about setting up different configuration files. It took me a long time to realize that there is no point in trying to memorize different configuration options. You see with Node and Express development, you are going to use a dozen third party NPM modules. All of these modules are created differently and have different configuration options. I tried to memorize and test myself time after time only to get frustrated. The truth is, you will still do well if you just look up the documentation.</p><p>Here’s how I want you to approach this:</p><ol><li>Decide what functionality you want to achieve</li><li>Search Google and find the best module for the job</li><li>Check their documentation or watch a video to configure it</li><li>Test that it’s working as you wanted to</li><li>Repeat the process</li></ol><p>In the early days, feel free to rely on all the modules out there. Once you get to an advanced level and know how to work with the built-in modules, maybe you will write your own custom functionality. But most importantly, practice and build a lot of stuff.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="practice-and-build-a-lot-of-projects">Practice and build a lot of projects<a href="#practice-and-build-a-lot-of-projects" class="hash-link" aria-label="Direct link to Practice and build a lot of projects" title="Direct link to Practice and build a lot of projects">​</a></h3><p>I practiced a lot when taking the node course. This is the key to learning and leveling up quickly. Don’t just sit there with your course project, build new things with what you already know. I built new projects from scratch every day that helped me practice my skills and build out a small portfolio.</p><p>Finally, don’t be afraid of putting out your work to the world. Learn how to deploy your project to the internet and show it to everyone. Sharing my work helped me learn more and get new opportunities. After finishing the Node course in 3 months, it was time for me to spend time building new projects. While building new projects, I got to learn even more stuff about Node JS.</p><p>Now that you have the tips to learn Node in record time, let me share some next steps for you to get started immediately.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="next-steps">Next Steps<a href="#next-steps" class="hash-link" aria-label="Direct link to Next Steps" title="Direct link to Next Steps">​</a></h2><ul><li>Decide what you want to build with Node JS</li><li>Check the <a href="/resources">resources page</a> if you are looing for a node course</li><li>Build lots of practice projects and learn from doing</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments:<a href="#comments" class="hash-link" aria-label="Direct link to Comments:" title="Direct link to Comments:">​</a></h2><p><strong>Chuks</strong>: Hello, Tamal. Thanks a lot for your very revealing article. I stumbled upon it on Quora after going through lots and lots of articles on JavaScript/Node.js. I have to say that you sort of described my current predicament.</p><p>So, I am actually new to programming. I started with Python last year (my first programming language), but then I got frustrated midway when I couldn’t build anything with it, and so I left it. I took up JavaScript this year, and because I wanted to do backend, I also started learning node. I bought two courses on Udemy, one on JavaScript, and the other on Node.js (by Andrew Mead).</p><p>Just like you mentioned, I am learning them side by side. I know just the basics of JavaScript, but I do not want to waste any time so I began on node immediately. I’m only just about 23 videos into the course (The course has almost 350 videos). I can’t wait to actually build something just so I can see the fruits of my labor.</p><p>I would love to be in correspondence with you and also follow you on social media, just to get some tips and advice as I embark on this journey. Once again thanks for this article, and I have to say that it has motivated me. I hope I would be able to complete this course because I am now fed up of leaving things halfway.</p><blockquote><p>Tamal: Hello Chuks, thank you for your insightful comment and I am so glad that my journey motivated you to stick with it. JS is good because you can quickly build stuff that you can show to other people. This is an awesome way to keep you motivated while you are learning.</p><p>Stick to your current Udemy course and try to complete most of it (if not 100%). For a large course that has 350 videos, you can take this shortcut: Instead of making it a task to view all the videos, you can review the section and learn the gist of the section. For example, if you have a section called REST API with 20 videos, you may learn the topic by viewing only 3-4 important videos from that and make it complete. You can always get back to other videos when you have finished a few practice projects.</p><p>Thank you for wanting to stay in touch with me. Unfortunately, last year I deleted all my social media accounts and stopped broadcasting what I am working on. You can bookmark this site for new articles and also send me an email to stay in touch privately.</p><p>See you on the comments!</p></blockquote><p><strong>Mohit Kumar</strong>: Hey, thanks for the tips. Just to give you a little background: I actually am a fresher who has been working in a company that uses dotnet technology. But the problem is that most of the stuff that is being used is older versions of the technologies. For instance, they have still not moved on to dotnet core and are stuck on an older version. Angular 1.7 is still being used which is quite old as compared to the latest version. Getting recruited directly from college, it wasn’t easy for us Freshers as the training the company provided was very bad for people who had no background in these technologies. Now 9 months on, I still feel I have not adjusted entirely. I had wanted to learn some new technology for the past few months now and I have recently developed an interest in learning Node js. So a couple of days ago, I started learning MEAN stack development mainly through YouTube. I am enjoying it at present, everything seems so great in Node. And I seem to be picking up the basics at least quite quickly. The only experience of JavaScript I have is with angular that we use in our current company.</p><p>Now coming to some of my questions, what do you have to say about working with dotnet technology from a career perspective? And should I learn Node js by myself for a few months and seek a job in MEAN stack technology? How much scope does Node/MEAN stack have from a career perspective and from a versatility perspective in building different types of applications?</p><blockquote><p>Tamal: Hello Mohit, thank you for your comment. I understand your need to work with the latest technologies. You have to find some time out of your job and build a few side projects with the MEAN stack. As for the career perspective, I still don’t have in-depth industry knowledge so I can’t say for sure. But what I have seen so far, technology stacks change all the time.</p><p>Ruby on Rails was all the hype, now it’s Node, then it will become Golang. Just because it’s not the hype, doesn’t mean people don’t use RoR anymore. In this industry, you have to learn a lot of technologies over your lifetime so learn how to build great software and don’t focus so much into specific tech stacks.</p><p>And about dotnet, I don’t want my opinion to change your mind. It’s a good technology and I am looking forward to moving towards .NET sometimes in the future, but for now, I am going to master Node JS and build a few projects until I become fully satisfied. dotnet here is the variable, any technology that solves the business problems is valuable. Learn how to solve business problems with technology and you will have better career opportunities.</p></blockquote>]]></content:encoded>
            <category>nodejs</category>
            <category>explainer</category>
            <category>opinion</category>
        </item>
        <item>
            <title><![CDATA[Is Node JS a Programming Language?]]></title>
            <link>https://tamalweb.com/is-nodejs-programming-language</link>
            <guid>https://tamalweb.com/is-nodejs-programming-language</guid>
            <pubDate>Mon, 27 Jan 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[Node is often compared with other backend languages such as PHP and Python, but is it actually a language? Today I am going to answer that question once and for all.]]></description>
            <content:encoded><![CDATA[<p>Node is often compared with other backend languages such as PHP and Python, but is it actually a language? Today I am going to answer that question once and for all.</p><p><img loading="lazy" alt="featured" src="/assets/images/featured-6f67502893fcc29f69ef67fe19a530e6.png" width="800" height="449" class="img_ev3q"></p><p>Is Node JS a programming language? <strong>Node JS is not a programming language, it uses JavaScript language as the main programming interface. Node is a desktop application (or runtime environment) that runs JavaScript files. It mainly reads and writes files on a computer/server and does networking.</strong></p><p>Node runtime can be compared to the JVM Java Virtual Machine or the IDLE Python interpreter. Whenever you want to write a program in a language, you have to install the software on your computer first. Think Node JS as that interpreter but for JavaScript files.</p><p>I often see people making a comparison of Node with other languages which then leads to silly fights between people that “you can’t make a comparison because it’s not a language” and all that. But when people do such comparisons, what they really mean is Node as the complete thing, and not just a language or the tool. So let me tell you a bit more about this runtime environment.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-is-the-node-runtime-environment">What is the Node runtime environment?<a href="#what-is-the-node-runtime-environment" class="hash-link" aria-label="Direct link to What is the Node runtime environment?" title="Direct link to What is the Node runtime environment?">​</a></h2><p>Unlike other languages like Python, Ruby and Go, JavaScript didn’t have any kind of runtime environment. JS was made exclusively for the browser and it could only do certain things within the confinement of a browser like Chrome, Firefox, and Opera. As a result, we don’t have any print command in JavaScript, nor any file read &amp; write option because JS doesn’t have any access to the computer’s file system. JavaScript was limited for doing simple page effects only. That changed when Ryan Dahl created the Node runtime environment (JSConf Europe, 2009).</p><p>The Node runtime environment is an application created in C++ which allowed the user to manipulate files on the computer. Dahl picked JavaScript as the programming interface for the Node runtime, and thus the name Node.js came (Dahl, 2009).</p><p>The Node environment was made similar to how the browser environment was made but with more capabilities so that we can make a web server out of it. This made it possible to write the backend of an application in JavaScript.</p><p>I won’t go in much detail of how exactly the Node runtime works, but I can tell you one thing that JavaScript gave Node a huge advantage when it comes to running a server and reading and writing files. The speed of Node JS made it possible to make efficient web applications and tools.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="why-javascript-was-picked-for-the-node-runtime">Why JavaScript was picked for the Node runtime?<a href="#why-javascript-was-picked-for-the-node-runtime" class="hash-link" aria-label="Direct link to Why JavaScript was picked for the Node runtime?" title="Direct link to Why JavaScript was picked for the Node runtime?">​</a></h2><p>Ryan Dahl, the creator of Node, picked JavaScript as the language because it supports all the features he needed and a large number of developers already know how to write it. To build high performant server applications we should use the non-blocking event I/O model; luckily JavaScript is built in such a way that it already supports callbacks and events (Dahl, 2009).</p><p><a href="https://www.youtube.com/watch?v=EeYvFl7li9E" target="_blank" rel="noopener noreferrer">https://www.youtube.com/watch?v=EeYvFl7li9E</a></p><p>To give you a clear example, let’s say I tell Node to write the user information in the database. Node will then send the request to the database. While the data is being written to the database, Node will not wait for it, instead, it will move on to the next task on the list. When the database gets back to Node, it will resume and do the appropriate action. This single attribute makes it possible to make faster and more efficient server applications.</p><p>Among other reasons, Dahl also mentioned that he picked JavaScript because it allows callbacks and has the option to supply functions as function parameters. JavaScript is a unique language and compared to other languages such as PHP, Java, and Python, it can do read-write operations much faster using a single thread.</p><p>By the way, Java and JavaScript are two different languages.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="are-java-and-javascript-the-same-thing">Are Java and JavaScript the same thing?<a href="#are-java-and-javascript-the-same-thing" class="hash-link" aria-label="Direct link to Are Java and JavaScript the same thing?" title="Direct link to Are Java and JavaScript the same thing?">​</a></h2><p>They are not. Java is an object-oriented general-purpose compiled programming language. JavaScript, on the other hand, is a specific-purpose interpreted scripting language. The confusion happens for having the same name because when Java was popular, JavaScript was created to bring Java developers to the web (Netscape, 1995).</p><p>For simplicity, Java is a platform for making desktop, web, and mobile (android) apps, while JavaScript is used for making web applications.</p><p>Both languages have similar looking syntax because JavaScript was created based off of Java. The one difference between their syntax is: in Java, you have to define the type of the variable, while in JavaScript you don’t have to set the type of a variable. This is why JavaScript is called a weakly typed language and Java being the strongly typed lang.</p><p>What is the difference between browser JS and Node JS?
The creator of Node JS took the original JavaScript language and made a custom implementation to it. To start off, in the browser, the global object is called window, but in Node, the global object is called global. This is because there is no browser window in a Node environment.</p><p>Since Node is capable of reading and writing files, there is a global method require which can read and include files from the directory. There is another module called fs (file system) for doing all the input and output operations.</p><p>All the browser-related APIs like the fetch, localStorage, Notification is not available in Node because it’s not a browser.</p><p>Node made few custom methods but kept the same name as the browser for consistency; like the console.log, setInterval, and setTimeout could be named anything but wasn’t.</p><p>On top of that, Node has a list of built-in modules that can help the user build a server and do all the CPU and server related tasks.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-node-js-is-used-for">What Node JS is used for?<a href="#what-node-js-is-used-for" class="hash-link" aria-label="Direct link to What Node JS is used for?" title="Direct link to What Node JS is used for?">​</a></h2><p>As you already know, Node is used for building server-side applications and this was the original plan. However, as time went on, developers found many new ways to use Node. Here are some of the prominent use cases:</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="node-as-a-full-stack-application">Node as a Full Stack Application<a href="#node-as-a-full-stack-application" class="hash-link" aria-label="Direct link to Node as a Full Stack Application" title="Direct link to Node as a Full Stack Application">​</a></h3><p>The best use of Node JS and the reason why I got into this was to be able to build full-stack web applications. Node is good for building all types of web applications. I made social networks with it such as the Twitter and Reddit clone. Other people have made SaaS applications, chat applications, and many different sites.</p><p>With Node, you can create the backend using a framework such as Express JS and build out the frontend with a view engine such as pug. Node renders HTML pages by dynamically generating them from the backend. It’s not just only limited to creating web applications, but you can also create just the backend of a server for any type of application.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="node-as-the-backend-api">Node as the backend API<a href="#node-as-the-backend-api" class="hash-link" aria-label="Direct link to Node as the backend API" title="Direct link to Node as the backend API">​</a></h3><p>Another popular use of Node JS is making the backend of any other type of application. You can make an android or iOS app to have it as the frontend and then make the API server using Node.js. Node is good for making REST APIs that can be used on any type of front end. You can even make a desktop application with Java or C++ and have Node to handle the server endpoints.</p><p>Currently, I like to make the backend with Node and use React.js as my frontend client application. With that being said, did you know that the biggest use of Node JS is currently in the frontend?</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="node-js-in-the-frontend">Node JS in the frontend<a href="#node-js-in-the-frontend" class="hash-link" aria-label="Direct link to Node JS in the frontend" title="Direct link to Node JS in the frontend">​</a></h3><p>Being a server-side platform, ironically Node JS is now hugely used on the frontend.</p><p>But it’s not the way you are thinking.</p><p>Using Node in the frontend does not really mean you are running Node.js in the browser. You see Node is very good when it comes to reading and writing lots of files in a short amount of time. Developers have used this feature to build lots of frontend tools. Nowadays, most of the popular tools in frontend development are built and run by Node JS.</p><p>For example, webpack is a popular tool for minimizing JS and CSS files. Webpack does this on the fly using Node. The same goes for other tools like babel, gulp, browserify and many more.</p><p>And this is the sole reason why you have to download and install Node even when you are working in the frontend using React or Angular. Node JS is everywhere when it comes to building web applications. Even if you are not building a web application, you may still encounter tools that are built using Node.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="advantage-of-learning-node">Advantage of learning Node<a href="#advantage-of-learning-node" class="hash-link" aria-label="Direct link to Advantage of learning Node" title="Direct link to Advantage of learning Node">​</a></h2><p>If you are ever going to build a web application, you will need to learn Node JS. The one big advantage of learning Node is that you will be able to port your skills from frontend to backend and vice versa. If you know how to use JavaScript to build server-side applications, you will find it easier to transition your way into the frontend. If you know how to work with frontend frameworks like React and Vue, you will find it easier to build backend APIs because it’s the same language. You can also reuse your existing code because both ends use JavaScript.</p><p>Since Node is the only tool out there for building the tooling and the backend services, you can make a good career being an expert in it. I am sure, over time there will be more and more uses of Node which you can benefit from.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="final-thoughts">Final Thoughts<a href="#final-thoughts" class="hash-link" aria-label="Direct link to Final Thoughts" title="Direct link to Final Thoughts">​</a></h2><p>Node JS is not a language, it’s a runtime environment, but these days when someone compares Node with another programming language, they mean the entire Node JavaScript ecosystem. The Node ecosystem is huge and so much is happening around it so I suggest you pick one aspect of it, such as building full-stack applications and practice building lots of applications.</p><p>If you are interested to get started with Node, here are some tips for you:</p><ul><li>Learn JavaScript because Node IS JavaScript</li><li>Pick one area and be awesome with it, build something</li><li>Comment on this post and let me know what do you think of Node</li></ul><h2 class="anchor anchorWithStickyNavbar_LWe7" id="references">References:<a href="#references" class="hash-link" aria-label="Direct link to References:" title="Direct link to References:">​</a></h2><ol><li>Dahl, R. (2009). Ryan Dahl: Original Node.js presentation. Retrieve on April 9, 2020, from <a href="https://youtu.be/EeYvFl7li9E?t=796" target="_blank" rel="noopener noreferrer">https://youtu.be/EeYvFl7li9E?t=796</a></li><li>JSConf Europe. (2009). Node.js by Ryan Dahl. Retrieved on April 9, 2020, from <a href="https://www.jsconf.eu/2009/video_nodejs_by_ryan_dahl.html" target="_blank" rel="noopener noreferrer">https://www.jsconf.eu/2009/video_nodejs_by_ryan_dahl.html</a></li><li>Netscape. (1995). Netscape And Sun Announce Javascript, The Open, Cross-platform Object Scripting Language For Enterprise</li><li>Networks And The Internet. Retrieved on April 9, 2020, from <a href="https://web.archive.org/web/20070916144913/http://wp.netscape.com/newsref/pr/newsrelease67.html" target="_blank" rel="noopener noreferrer">https://web.archive.org/web/20070916144913/http://wp.netscape.com/newsref/pr/newsrelease67.html</a></li></ol>]]></content:encoded>
            <category>nodejs</category>
            <category>explainer</category>
        </item>
        <item>
            <title><![CDATA[What Language Should I Learn to Build a Social Network?]]></title>
            <link>https://tamalweb.com/what-language-for-social-network</link>
            <guid>https://tamalweb.com/what-language-for-social-network</guid>
            <pubDate>Sun, 26 Jan 2020 00:00:00 GMT</pubDate>
            <description><![CDATA[Today I am going to tell you what programming language you should learn if you want to build a social networking site like Twitter, Reddit, Facebook, or Instagram.]]></description>
            <content:encoded><![CDATA[<p>Today I am going to tell you what programming language you should learn if you want to build a social networking site like Twitter, Reddit, Facebook, or Instagram.</p><p>So what is a good language for building a social network? <strong>JavaScript. Out of all the languages and tools, JavaScript helped me quickly build a social networking site using Node JS. As a beginner I found Node JS to have the shortest learning curve when it comes to building a full-stack application such as Twitter and Reddit.</strong></p><p>Now that you know you can learn JavaScript as your programming language and use Node JS as your tool to build the site, let me give you an overview of what goes into a full-stack application. I will also share with you why did I pick the JavaScript tech stack and not the other options such as PHP or Ruby on Rails. So without further ado, let’s get going.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="what-goes-into-building-a-social-networking-website">What goes into building a social networking website?<a href="#what-goes-into-building-a-social-networking-website" class="hash-link" aria-label="Direct link to What goes into building a social networking website?" title="Direct link to What goes into building a social networking website?">​</a></h2><p>A social networking site is a kind of dynamic web application that was made popular by sites like MySpace and Facebook. It got even more popular with the creation of Twitter and then came mobile-centric social networking sites like Instagram, Snapchat and TikTok.</p><p>The implementation may be different for various sites, but at a very basic level, all of these sites have a few things in common. When you go out and build such an application, you are doing the full-stack development. In other words, you are gonna make every aspect of the app.</p><p>A full-stack application consists of a frontend and a backend. The backend has many parts including the database. To make it easier to explain, I will talk about databases separately and what role they play in a social media site.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="frontend">Frontend<a href="#frontend" class="hash-link" aria-label="Direct link to Frontend" title="Direct link to Frontend">​</a></h3><p>A social networking site has a public-facing user interface which is usually a page for the non-logged in users. On Facebook when you go to <a href="http://www.facebook.com" target="_blank" rel="noopener noreferrer">www.facebook.com</a> from a different computer (or when you are logged out) you will see a page instructing you to sign up for an account. You can see a similar theme going on Twitter and Instagram where they prompt you to sign up for a new account or download their mobile app.</p><p>You will notice that on Twitter, you can see all the tweets from an individual user because Twitter’s policy is to make all the tweets public for the entire world, even to the logged out users. Similarly, Reddit allows everyone to read and consume their site without even having to create an account; they can only post content or reply to other people when they create an account. Another aspect of a dynamic website is that it changes based on the user.</p><p>When you log in to Facebook and visit <a href="http://www.facebook.com" target="_blank" rel="noopener noreferrer">www.facebook.com</a> on your browser, you will find that the page shows completely different content. This page will now show the home feed of the updates from your friends, the brands and celebrities you follow and the posts from the groups you have joined.</p><p>Similarly, on Twitter, the home page is a custom feed of all the tweets from the people you follow.</p><p>In Reddit, the homepage will be a personalized feed containing the subreddit you are following or frequently browse.</p><p>Not just that, if your friend logs into any of these social networking sites, they will see a completely different feed based on his/her preferences.</p><p>This is the true beauty of a dynamic web application.</p><p>There are more than a billion social media users and for each of them the content they see on the same page changes from person to person.</p><p>You may wonder, for a billion users there are a billion profile information pages, but does that mean a web developer had to painstakingly have to build a billion profile pages?</p><p>Of course not.</p><p>The frontend web developer has only created one page for the profile page using HTML, CSS, and JavaScript. The frontend is no more than an empty shell waiting to be populated with user data from the database.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="database">Database<a href="#database" class="hash-link" aria-label="Direct link to Database" title="Direct link to Database">​</a></h3><p>If there are a billion users on Facebook, there must be a way to store and manage all that information, the names, the birthdays, the passwords, the list of their friends, the pages they like, you get the idea!</p><p>On top of that, it should be easy and quick to fetch the information of a given person in a short amount of time. To solve this a database is used to store all the dynamic information for your social network.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="simple-store-of-data">Simple store of data<a href="#simple-store-of-data" class="hash-link" aria-label="Direct link to Simple store of data" title="Direct link to Simple store of data">​</a></h4><p>When I went on to build a social networking app with Node JS, I learned that a database is nothing more than a simple text file. In fact, I can make a database out of a text file if I wanted to.</p><p>Every time someone creates a new account, I will create a new entry in my text file with the username, password, and other information. When that user tries to log in again, I will just check if the username exists in my text file and if the given password is correct, I will allow the user to log in.</p><p>The problem comes when I have to take and manage more data. In my custom social network, I just can’t have a user log in and do nothing. The user may want to post something, like a Tweet or a status update. I will then have to store status messages on my text file.</p><p>Maybe having two different text files for user data is a good idea. I will use my first text file to store the user information and the other text file for all the status updates in my network posted by all the users.</p><p>But then comes the problem,</p><p>How can I know who posted which status update or which update belongs to which user?</p><p>A nice solution could be giving a unique ID to each of my users and also putting this ID next to the status update so that each of the status updates will link to a user in my user’s text file and vice versa. This type of relationship is very common in relational databases, and it’s in fact how large complex databases work.</p><p>If I am reading the user file line by line from top to bottom it will take a significant time for a computer to find particular user info. I will also have to worry about generating unique ids for each of the users, the status updates and any other fields. It turns out, other people before me have already gone through these problems and have come up with a very good solution:</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="real-databases">Real databases<a href="#real-databases" class="hash-link" aria-label="Direct link to Real databases" title="Direct link to Real databases">​</a></h4><p>A database is nothing but a special data structure to efficiently hold and retrieve data.</p><p>When Facebook was originally created, Mark Zuckerburg used a MySQL database for building the site. Today there are many different databases to choose from like MySQL, MS SQL, PostgreSQL, SQLite, MongoDB, Oracle DB, DynamoDB and many more. But at the core, all the databases make it efficient to store and retrieve data about your web application.</p><p>When I built my first social network I used MongoDB with Node JS. Mongo is a popular No SQL database that is similar to the JSON data format (JSON is data representation in JavaScript object notation). MongoDB goes hand in hand with Node JS because the way it organizes data and the commands to store and retrieve data are similar to JavaScript language.</p><p>When you go on building a social network, you will have to use a database to store all the dynamic content in it. A database is like the heart of a web application and you must pay extra attention to protect it. If you lose it or the data gets corrupted, your entire database will be gone in an instance. So it’s a good idea to pay a premium for a database and keep regular backups in case something goes wrong.</p><p>A database is the content of a social network, but the brain that makes everything come together is the backend of your application.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="backend">Backend<a href="#backend" class="hash-link" aria-label="Direct link to Backend" title="Direct link to Backend">​</a></h3><p>A simple HTML, CSS website does nothing, because there is no database to store the content and no mechanism in the backend to do the logic. For every social network out there, the real magic happens in the backend of the application.</p><ol><li>The frontend will greet the visitor and take an order (request). The user registers for a new account with a name, email, and password.</li><li>The frontend will then send the request to the backend server. In this case, the information submitted by the user on the form.</li><li>The backend code lives somewhere in the server and is always listening for incoming requests.</li><li>The backend will receive a new request for registering a new user with all the information.</li><li>The backend will check and verify the name, email, and password, making sure the email is not already taken.</li><li>If everything is okay, the backend will create a new entry for the user in the database and tell the front end (response) to log this user into the account and display the home feed.</li><li>The frontend will receive the new response to log the user in and display the home feed so it will do it accordingly.</li></ol><p>This is, of course, a simple representation of the request-response cycle. In a nutshell, every time the user clicks on something on the frontend, every time they post a comment or every time they move to a different page, a new request is sent to the backend for processing; the frontend then gets a new response back with some data to display to the user.</p><p>And all of this happens in less than a second.</p><p>If you want to build a social network, you will have to follow a design pattern. The most popular design pattern for building a social network is the MVC design pattern. MVC stands for Model, View, Controller; Twitter and many other social networking apps and even SaaS apps are built using this pattern. Express JS is a Node JS framework that makes it easy to build an application with the MVC design pattern. Let me share the core concepts in detail below,</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="model">Model<a href="#model" class="hash-link" aria-label="Direct link to Model" title="Direct link to Model">​</a></h4><p>Model in MVC is the database layer where all the data is stored that will determine the makeup of the data. In Node.js development when you will be using MongoDB to build your database, you will have to provide the data structure within your server files. For a user, the data structure could be the username, first name, last name, email, password, date of birth, etc. A model is responsible for storing and retrieving the data for the entire application.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="view">View<a href="#view" class="hash-link" aria-label="Direct link to View" title="Direct link to View">​</a></h4><p>A view in MVC is the user-facing interface that the user can interact with. When I went to build a social network in Node JS, I used pug to build the dynamic HTML templates. A pug file is like a template where I can include custom JavaScript variables which will render real information to the user. Depending on the kind of user, the view layer can show different information based on the logic. Other options to build a view layer in Node JS are ejs, handlebars, and mustache.</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="controller">Controller<a href="#controller" class="hash-link" aria-label="Direct link to Controller" title="Direct link to Controller">​</a></h4><p>A controller in MVC is the main logic or the brain of the application. In Node JS, this is achieved by making lots of functions and handlers for different requests. For each of the different requests, there will be different handlers and different functions.</p><p>To illustrate this, when someone posts a status update, the front end will send a POST request to the /post handler with the appropriate content. A controller will have a bunch of different handlers so it will then route this request to the handler which deals with posting new status updates.</p><p>Let’s say the handler is a function in JavaScript called postStatueUpdate. This function will then take the status update and perform other tasks like storing the update to the MongoDB database. When the update is stored, it will send a response to the frontend that it was successful. Now finally the controller will tell the front end to display the new post to the view layer. In a nutshell, the controller is the central nervous system that works constantly with the model and the view layer of the app.</p><p>Now that you have an overview of what goes into a social network, let me tell you why Node JS is a good tool for a beginner to build a full-stack application.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="why-use-node-js-to-build-a-social-networking-app">Why use Node JS to build a social networking app?<a href="#why-use-node-js-to-build-a-social-networking-app" class="hash-link" aria-label="Direct link to Why use Node JS to build a social networking app?" title="Direct link to Why use Node JS to build a social networking app?">​</a></h2><p>Now you must be thinking, if I have all the many different options to build my backend server, why would I pick Node.js to build it? The first reason is speed.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="speed">Speed<a href="#speed" class="hash-link" aria-label="Direct link to Speed" title="Direct link to Speed">​</a></h3><p>Node JS is fast when it comes to reading and writing data to and from the disk. A social networking website is all about user-generated content where users will create posts, comment on them, like, dislike and delete posts. This all means your application will have to do a lot of updates to the database and one thing I learned after building a bunch of applications is, that database updates take a significant amount of time.</p><p>Node JS is asynchronous and can handle all the requests one after the other without impacting the user interface. In traditional server-side languages, like in PHP, Java, and Python, the server will wait until read/write operation is complete. But in Node JS, it will send the read/write action to the queue and go on working on other requests. When the read/write action is complete, it will respond accordingly. This gives a huge advantage to a social networking site, where lots of requests are happening simultaneously. As a beginner, you would want to pick a tool that is easier to learn fast.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="ease-of-learning">Ease of learning<a href="#ease-of-learning" class="hash-link" aria-label="Direct link to Ease of learning" title="Direct link to Ease of learning">​</a></h3><p>Node JS is JavaScript and if you already know how to build a simple website with HTML, CSS, and JavaScript, the learning curve will cut down in half.</p><p>Node application structures are built with a straight forward functional approach. When building my Twitter clone application, I used the Express framework which is just a collection of useful methods for making APIs and handlers. The process of making a Node JS application is as simple as making a bunch of functions that call each other at various stages. A typical Node project heavily relies on packages that are functions other people wrote which you can freely use. Node project also has a lot of set configurations that you can just copy-paste from boilerplate code.</p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="one-language">One language<a href="#one-language" class="hash-link" aria-label="Direct link to One language" title="Direct link to One language">​</a></h3><p>Finally, Node JS lets you use a single language, JavaScript to do both the frontend and the backend of an application. In other technological stacks like in PHP, Python, Ruby, and Java, you will still have to do the frontend logic with JavaScript which means you will have to work with a minimum of two programming languages at a time.</p><p>As a beginner programmer, I had a hard time working with JavaScript in the front and PHP in the back. I was forgetting one language when I was working with the other. Node JS helped me focus only on JavaScript and I was able to build a full-stack social network with ease.</p><p>So if you are a new programmer, and would like to learn a single language to build the entire stack, then pick Node JS. Your JavaScript tech stack will look like this:</p><ul><li>Node JS -The runtime environment for the server</li><li>Express JS -Framework to build your application</li><li>MongoDB -A powerful database built on JS principles</li><li>Pug, ejs, handlebars -for creating the view layer</li><li>Frontend frameworks: React, Angular, Vue</li></ul><p>(You can always learn new backend technologies once you have gained enough confidence with your first few projects.)</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="next-steps">Next Steps<a href="#next-steps" class="hash-link" aria-label="Direct link to Next Steps" title="Direct link to Next Steps">​</a></h2><ul><li>Download the latest LTS version of Node JS and install in your computer</li><li>Learn how to make a simple web app using the Express JS framework</li><li>Make a few learning projects by storing and retrieving from MongoDB database</li></ul>]]></content:encoded>
            <category>nodejs</category>
            <category>javascript</category>
            <category>explainer</category>
        </item>
        <item>
            <title><![CDATA[How I made The Periodic Table with CSS Grid and React]]></title>
            <link>https://tamalweb.com/periodic-table-reactjs</link>
            <guid>https://tamalweb.com/periodic-table-reactjs</guid>
            <pubDate>Thu, 26 Dec 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[I was looking into the periodic table and trying to memorize all the elements in order. One afternoon I thought, hey can I make the periodic table with my current CSS skills?]]></description>
            <content:encoded><![CDATA[<p>I was looking into the periodic table and trying to memorize all the elements in order. One afternoon I thought, hey can I make the periodic table with my current CSS skills?</p><p>The periodic table is a collection of elements arranged in an oddly structured way. It has already been built in the past, but the question is, can I do it myself without looking?</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="making-the-layout">Making the Layout<a href="#making-the-layout" class="hash-link" aria-label="Direct link to Making the Layout" title="Direct link to Making the Layout">​</a></h2><p>The first task was to arrange all the elements in the peculiar order. The first idea that came into my mind was to make an HTML <code>&lt;table&gt;</code>, and put all the items inside the table cells. But tables are old and messy, not to mention, they are very hard to maintain.</p><p>I know CSS grid, so why not use that?</p><p>At that point I was a bit skeptical, and thought maybe I will have to use flexbox to achieve the task.</p><p>So each of these elements will be a <code>&lt;div&gt;</code>, and I will arrange them with CSS.</p><p>I made the elements like this:</p><p><img loading="lazy" alt="elements" src="/assets/images/1-afadc042b8c902051c5c1472f51487f8.png" width="844" height="254" class="img_ev3q"></p><p>I put 2 classes, the element class to make the box, and element-1 to specifically control the position. I would have 118 elements altogether.</p><p>Instead of hand coding all 118 divs for my table, I used the emmet shorthand:</p><p><img loading="lazy" alt="emmet shorthand" src="/assets/images/2-6e9067de876596ce24e0794acf624506.gif" width="400" height="244" class="img_ev3q"></p><p>The table has 18 columns, so I made an 18 column layout with CSS grid.</p><p><img loading="lazy" alt="css grid" src="/assets/images/3-1fda4bc25dcddf645d5323dd5677f53d.png" width="978" height="470" class="img_ev3q"></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-tricky-part">The Tricky Part<a href="#the-tricky-part" class="hash-link" aria-label="Direct link to The Tricky Part" title="Direct link to The Tricky Part">​</a></h2><p>Okay, so now that I have the container ready, I have to put Hydrogen as the first element and Helium all the way to the right.</p><p>I did this:</p><p><img loading="lazy" alt="element 2" src="/assets/images/4-a58ad2f3463630997af2902c0e55f982.png" width="708" height="362" class="img_ev3q"></p><p>And it worked!</p><p><img loading="lazy" alt="periodic layout" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABMgAAABgCAIAAABnrNnIAAAHcElEQVR42uzdMWhb+eHA8ac/Hjz8BxU6yOBAVa7DHRfoiRYkww2ncIVeuSEWMdiajtzS+qZEdKhFhrPVoc25y4UuNR2KZTgjeTi4DqGvw4FlKNiBG9IhoEIE1pBBQ+A8HLxiSU6s5ILVWErs589nOv30k17ek5bv/X7Wm4iiKAAAAICX9X8uAQAAAMISAAAAYQkAAICwBAAAQFgCAACAsAQAAEBYAgAAICwBAAAQlgAAACAsAQAAGKuJYSZ1Op0YnGoymfR5AwAAr8aFyqiJC1Jl8fhQAQCA+FVZDDLKVlgAAABORVgCAAAgLAEAADhfYdneKFR2XDoAAIAh7FQSXYWNtrDsaVQSiamFuu8GAADAUBHVTO9HURTtF7bWGsKyK7cURfvVWV8OAACAoSJqfiEV93Oc8DEDAACMW3tjsXmjtiAsAQAAeImorM5N1a7u17KxPUNhCQAAMEaN5cVgNapNx/kc3W4EAABgjF0Z3qoXL/V+FzYR1/trJKIoOnFSp9NJJpPn+jxjcAoAAIAGOZun8ApWLBv9m7YcM0Smv9yrAAAAzr64VZKtsAA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LPDFz63AkNV/KbIXdsmyHW5nSfFC9Ucw0okPvB+X+6+rFB/koipay7ercTNB79uH6bu7wujSWZ3ar+4cjq+ndze70ncpicKc7aT+92rt25VpvpJEp/rXhCwcAAJxjm8WpJ2V1qVgPXtRBJ+qn1v7V2lQizPc6a3WM+2ZHE5YrvSbs2v60N5bLX66FrSBohbXL+VwrrAXr17PdZ7L5lf7rZtc/ynVT+9iz0wulT3ebrUZ4a6U0n+qO5AvXuvV9t1xf6F3nqeLmbrN1eOT+nKfvCQAAcD5dW99/UlYP12eDF3XQifqplUpnZqvXc72qujzGf/gYfxU2936m9nW7/XUt835uVO95rGBrC9O+dwAAQPyd/Q4a5+1GsvnM1traViafDYLpdGazu4AZBMFOWH5m5nS+EBTXelt+W9XbtzLp6XT6Wjnsj4S17lbY9Buz5VU/JwsAAFwgQ3RQP53aG7fLMQzLIJe/XN692l14DXJLjUzxUnf99m7w3LbV1MLq+m7vDzUv1QoPl3LHR240M92tsKn52vbloz3HblgCAABcACd2UO6jfjotBoXX9ReCiSiKTpzU6XSSyeT//ubt6txisHrqtdpWtXAjuPPFQuoU7/GypwAAAHBBG2T4Uxjj7UYSiana1TsvXZWN5Se/htQsna4qAQAAGJ+xrlj6vwUAAMAFZcUSAAAAhiUsAQAAEJYAAAAISwAAAIQlAAAAF9FQvwp7cHAQg1OdnJz0eQMAAK/GhcqoocISAAAAXsRWWAAAAIQlAAAAwhIAAABhCQAAgLAEAAAAYQkAAICwBAAAQFgCAAAgLAEAAEBYAgAAICwBAAAQlgAAAAhLAAAAEJYAAAAISwAAAIQlAAAAwhIAAAC6/hsAAP//tRfNXDaoWt4AAAAASUVORK5CYII=" width="1224" height="96" class="img_ev3q"></p><p>One by one, I arranged the elements in this manner. Since I append the exact element’s number as the class for each cell, I can easily control their positions in the table.</p><p><img loading="lazy" alt="arranging the elements" src="/assets/images/6-d078a71933eed43deedf085c602c7fbc.png" width="826" height="578" class="img_ev3q"></p><p>In the periodic table, there is a large gap between elements. Let’s take a look — the original periodic table is very long, about 32 columns:</p><p><img loading="lazy" alt="32 columns" src="/assets/images/7-0d2c0ed171bb5055d19809e2a48eb1b8.png" width="768" height="239" class="img_ev3q"></p><p>To prevent it from being this wide, there are versions of the table which carve out a separate grouping of elements. I had to do the same with my table.</p><p>So what I did was to separate the Lanthanide and Actinides from the markup and from the CSS.</p><p><img loading="lazy" alt="split" src="/assets/images/8-eef7aefe267c01724db66536ff9f36e5.png" width="776" height="398" class="img_ev3q"></p><p><img loading="lazy" alt="layout without colors" src="/assets/images/9-646c4f4fd2cb59d7d03dd79ed19ec21b.png" width="1234" height="651" class="img_ev3q"></p><p>After the layout was ready, it’s now time to add the React.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="filling-the-table-with-data">Filling the Table with Data<a href="#filling-the-table-with-data" class="hash-link" aria-label="Direct link to Filling the Table with Data" title="Direct link to Filling the Table with Data">​</a></h2><p>It was all fun and games filling out the first few elements. But soon I realized there are 100s of elements that needed to be added. Do I have to type out ever single one? It would suck the fun and life out of me.</p><p>So why not do the smart thing and pragmatically fill out the info?</p><p>I searched the internet and <a href="https://github.com/Bowserinator/Periodic-Table-JSON" target="_blank" rel="noopener noreferrer">found one JSON</a> which has information about all the 118 items. So I added this data to my application.</p><p>In the JSON, there is an array of elements. My idea was to reference each element by their order. In an array, the first item starts at 0. That means Hydrogen is at zero, Helium is at 1, Lithium at 2 and so on. To avoid this confusion, I added a placeholder item in the 0th position. So now every element is correctly in the same position as it is in the periodic table.</p><p>Now that I have the data that I need, I can just make one React component to render all the elements and pass in the data as props.</p><p>Initially, I thought I need to pass in the name, the number, and the symbol of the element as the props to the React component.</p><p><img loading="lazy" alt="element component" src="/assets/images/10-d24e603d523e32c7b0feb869dcb27ad0.png" width="978" height="290" class="img_ev3q"></p><p>Then I realized I can just pass in the element’s number, and that would be enough to use the JSON data to extract the entire information about that particular element within the <code>&lt;Element /&gt;</code> component.</p><p><img loading="lazy" alt="elements" src="/assets/images/11-c12e75b0bafa83045c08036310897143.png" width="524" height="398" class="img_ev3q"></p><p>The rest was all about making the app interactive.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="coloring-the-element-groups">Coloring the Element Groups<a href="#coloring-the-element-groups" class="hash-link" aria-label="Direct link to Coloring the Element Groups" title="Direct link to Coloring the Element Groups">​</a></h2><p>In the Periodic Table, each of the elements are ordered by their category and they are colored. So instead of coloring each of them I put their categories on the CSS too using the React component.</p><p><img loading="lazy" alt="adding classes" src="/assets/images/12-540f129b4e79320e3ce0b6ab629d6cf1.png" width="1148" height="254" class="img_ev3q"></p><p><img loading="lazy" alt="css styles" src="/assets/images/13-35357baf7e5fb02ba3baf650269716ad.png" width="269" height="482" class="img_ev3q"></p><p>This gave the table that cool look.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="making-the-table-fit-the-screen">Making the Table Fit The Screen<a href="#making-the-table-fit-the-screen" class="hash-link" aria-label="Direct link to Making the Table Fit The Screen" title="Direct link to Making the Table Fit The Screen">​</a></h2><p>To start, I made the table 1000 pixels in wide following the general layout practice. But that made the elements too tiny.</p><p>So I decided to make it fit the screen and utilized viewport width exclusively. I used vw for the element dimensions, text, and headings throughout the app. This helped to maintain the shape across screen sizes and devices. The table is mainly made for desktop screens, but it still looks okay on tablets too.</p><p><img loading="lazy" alt="responsive design" src="/assets/images/14-25cb354b27080c01f4ef98af17e2cc96.gif" width="400" height="300" class="img_ev3q"></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="final-touches">Final Touches<a href="#final-touches" class="hash-link" aria-label="Direct link to Final Touches" title="Direct link to Final Touches">​</a></h2><p>The table is not complete if it just sits there doing nothing. I added a panel which displays additional information about the element when selected. React was great for this job. So why don’t you see it for yourself in action here?</p><p><img loading="lazy" alt="periodic table version 1" src="/assets/images/15-63462213a254b57b8c715654ff794a0e.jpg" width="1200" height="630" class="img_ev3q"></p><p>There are more things happening in the code, why don’t you dig inside and see it yourself? I welcome you to <a href="https://github.com/tamalweb/periodic-table" target="_blank" rel="noopener noreferrer">copy the code/fork it from Github</a>.</p>]]></content:encoded>
            <category>reactjs</category>
            <category>projects</category>
        </item>
        <item>
            <title><![CDATA[Fruit Ninja Random Fruit Facts API Built with Pure Node.js]]></title>
            <link>https://tamalweb.com/fruit-ninja-facts</link>
            <guid>https://tamalweb.com/fruit-ninja-facts</guid>
            <pubDate>Tue, 05 Nov 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[I started learning how to work with pure Node webserver (without Express or any other packages) The best way to solidify the learning is to build something with the knowledge. However, with the limited scope of the lesson, I couldn’t find a project to build.]]></description>
            <content:encoded><![CDATA[<p>I started learning how to work with pure Node webserver (without Express or any other packages) The best way to solidify the learning is to build something with the knowledge. However, with the limited scope of the lesson, I couldn’t find a project to build.</p><p>I’m playing Fruit Ninja these days. After every round, it shows interesting fruit facts. I got an idea to make an API that will display random fruit facts in JSON format. This way I can put my knowledge to use while building something fun.</p><p>I built this simple API which shows interesting fruit facts in JSON format. When you type in <code>localhost:3000/apple</code> or any other available fruits, it will spit out this data.</p><p>The API is simple yet sophisticated. This is the first time I’m building a URL slug which acts as a variable. It’s the same as <code>/:fruit</code> in express.js.</p><p>I suggest you <a href="https://github.com/tamalweb/fruit-facts/blob/master/index.js" target="_blank" rel="noopener noreferrer">open the up the code</a> and follow along with this post.</p><p>The idea is to take the full URL <code>http://localhost:3000/mango</code> and split it into parts. Then I take the path /mango and strip out any slashes to get a final clean trimmed path mango after which I can match the slug against my route handlers. I learned this way doing it from Pirple’s Node Masterclass course.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> parsedUrl </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> url</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">parse</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">req</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">url</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token boolean">true</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> trimmedPath </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> parsedUrl</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">pathname</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">replace</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token regex regex-delimiter">/</span><span class="token regex regex-source language-regex">^\/|\/+$</span><span class="token regex regex-delimiter">/</span><span class="token regex regex-flags">g</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">''</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token operator" style="color:rgb(212, 212, 212)">!</span><span class="token plain">trimmedPath</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> trimmedPath </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'index'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>I collected these fruit facts from a wiki page. I will write about how I scrapped those facts with JavaScript in another post.</p><p>I create an array of available fruits. Many fruits have more than one fact so I created an object of fruits with an array of facts for every fruit:</p><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">apple</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    'The average person eats </span><span class="token number" style="color:rgb(181, 206, 168)">65</span><span class="token plain"> apples per year'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    'Apple seeds are mildly poisonous</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> but not enough to be dangerous to humans'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    'There are over </span><span class="token number" style="color:rgb(181, 206, 168)">10</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token number" style="color:rgb(181, 206, 168)">000</span><span class="token plain"> varieties of apples grown around the world'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token string" style="color:rgb(206, 145, 120)">"25% of an apple's volume is air, that’s why they float"</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    'Over </span><span class="token number" style="color:rgb(181, 206, 168)">60</span><span class="token plain"> million tons of apples are grown worldwide annually'</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Other than the fruit facts, the API also has 3 additional pages — the homepage, a not found page, and a help page. First I check if the given URL slug is a matching fruit. If it’s a matching fruit, it will serve the fruit handler with the given fruit. If it doesn’t include a matching fruit but matches the other handlers, it will serve them accordingly:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> chosenHandler</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">fruits</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">includes</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">trimmedPath</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  chosenHandler </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> handlers</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">fruit</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">else</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  chosenHandler </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword" style="color:rgb(86, 156, 214)">typeof</span><span class="token plain"> router</span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token plain">trimmedPath</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">!==</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'undefined'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">      </span><span class="token operator" style="color:rgb(212, 212, 212)">?</span><span class="token plain"> router</span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token plain">trimmedPath</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">      </span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> handlers</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">notFound</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Then all is left to do is to call the chosenHandler function and pass in the callback function:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token function" style="color:rgb(220, 220, 170)">chosenHandler</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">trimmedPath</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">statusCode</span><span class="token parameter punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token parameter"> payload</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    statusCode </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(86, 156, 214)">typeof</span><span class="token plain"> statusCode </span><span class="token operator" style="color:rgb(212, 212, 212)">===</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'number'</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">?</span><span class="token plain"> statusCode </span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(181, 206, 168)">200</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    payload </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(86, 156, 214)">typeof</span><span class="token plain"> payload </span><span class="token operator" style="color:rgb(212, 212, 212)">===</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'object'</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">?</span><span class="token plain"> payload </span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> payloadString </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token known-class-name class-name" style="color:rgb(78, 201, 176)">JSON</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">stringify</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">payload</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token comment" style="color:rgb(106, 153, 85)">// Send the response</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">setHeader</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'Content-Type'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'application/json'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">writeHead</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">statusCode</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">end</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">payloadString</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>We use the native http package to create a web server. The server is built using http.createServer. The createServer function takes a callback where we can handle requests and serve fruit facts or other pages from <code>chosenHandler</code>. We then listen to port 3000 using server.listen.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> server </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> http</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">createServer</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">req</span><span class="token parameter punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token parameter"> res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// Callback to handle requests with chosenHandler</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">server</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">listen</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token number" style="color:rgb(181, 206, 168)">3000</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'Server started'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>You can tinker with the code on my Github page. I suggest you install the JSON viewer extension to see the JSON in a nice formatted way.</p>]]></content:encoded>
            <category>nodejs</category>
            <category>project</category>
        </item>
        <item>
            <title><![CDATA[These 7 Tips Will Make You A Super Productive Programmer]]></title>
            <link>https://tamalweb.com/super-productive</link>
            <guid>https://tamalweb.com/super-productive</guid>
            <pubDate>Thu, 26 Sep 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[These are some of the general programming tips I want to share with you. Some of these tips might sound trivial but they can sure help you be more productive. Here goes my 7 tips to help you become a super productive programmer.]]></description>
            <content:encoded><![CDATA[<p>These are some of the general programming tips I want to share with you. Some of these tips might sound trivial but they can sure help you be more productive. Here goes my 7 tips to help you become a super productive programmer.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="learn-touch-typing">Learn touch typing<a href="#learn-touch-typing" class="hash-link" aria-label="Direct link to Learn touch typing" title="Direct link to Learn touch typing">​</a></h2><p>Touch typing is typing with all of your 10 fingers. Many computer users don’t know how to touch type and they use one or two fingers to type out. Even I was a two-finger typer for a long time. If you learn touch typing, you can type without looking or even in the dark. You will also be able to type at the speed of your thought. Without it, you will constantly have to look for the keys and make mistakes.</p><p>As a programmer, your full attention should be on the problem at hand, not where the keys are. You can learn touch typing within a few weeks by using this free service called TypingClub.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-a-linter-to-auto-format-your-code">Use a linter to auto-format your code<a href="#use-a-linter-to-auto-format-your-code" class="hash-link" aria-label="Direct link to Use a linter to auto-format your code" title="Direct link to Use a linter to auto-format your code">​</a></h2><p>There are many code linting plugins out there that can format your code upon save. Don’t waste your time trying to manually add spaces, missing semi-colons or trying to match your desired syntax format. Use a syntax formatting plugin for your code-editor and let that take care of it for you. Set your style once and don’t ever worry about it again. Clean code is not just efficient, it will also make you look professional. I use Prettier for VS Code to lint my code.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-half-the-screen-for-coding">Use half the screen for coding<a href="#use-half-the-screen-for-coding" class="hash-link" aria-label="Direct link to Use half the screen for coding" title="Direct link to Use half the screen for coding">​</a></h2><p>If you are using a single monitor just like me, you can save trouble by making the code editor half the size of your screen. This way you can code on one side and use the rest of your screen for other things like reading the documentation or previewing changes, so you won’t have to switch windows all the time and can focus on the problem at hand.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="learn-to-use-version-control-git-and-publish-to-github">Learn to use version control (Git) and publish to Github<a href="#learn-to-use-version-control-git-and-publish-to-github" class="hash-link" aria-label="Direct link to Learn to use version control (Git) and publish to Github" title="Direct link to Learn to use version control (Git) and publish to Github">​</a></h2><p>If you want to become a software engineer, then you will have to learn how to work in a team. A version control system such as git can help you and your teammates work on the same code all at once. Github is a popular online git repository where you can host your code for free. I use git to version control my files and then upload them to Github. This way I get to have a backup of my code and also show off my work. VS Code has git feature built-in which makes it easier for committing and branching code. If you are having trouble with git commands, take a look at this no bullshit guide to git.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="spend-some-time-learning-about-your-system">Spend some time learning about your system<a href="#spend-some-time-learning-about-your-system" class="hash-link" aria-label="Direct link to Spend some time learning about your system" title="Direct link to Spend some time learning about your system">​</a></h2><p>If you want to be super productive, you must know 3 things really well:</p><ol><li>Your operating system</li><li>Your code editor (like VS code)</li><li>The language you are working on</li></ol><p>By learning about them means you should know the keyboard shortcuts, how to find things and how to troubleshoot errors. Having good knowledge won’t actually make a good programmer, but it will sure make you productive. So when the next time you are not doing anything, look into the different menu items, try different keyboard shortcuts or open up the documentation and learn something new about your system.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="play-some-gameswatch-a-tv-show-without-guilt">Play some games/watch a TV show without guilt<a href="#play-some-gameswatch-a-tv-show-without-guilt" class="hash-link" aria-label="Direct link to Play some games/watch a TV show without guilt" title="Direct link to Play some games/watch a TV show without guilt">​</a></h2><p>Every once in a while you should play your favorite game or watch a TV show. You cannot just code 24/7, you also need to recharge your mind. When you are playing, don’t feel guilty about it. You may be spending the whole day playing a game, but that’s okay, you need it. When you are playing a game, you can think about the character or the environment, how did the developer program it? What was the variable or conditions that trigger this event? TV shows and movies are stories of people dealing with problems. You can watch a story and get some inspiration to solve your programming problems or build something new. You never know what you can get out of it to use it on your programs, so take some break!</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="go-away-from-your-computer-every-once-in-a-while">Go away from your computer every once in a while<a href="#go-away-from-your-computer-every-once-in-a-while" class="hash-link" aria-label="Direct link to Go away from your computer every once in a while" title="Direct link to Go away from your computer every once in a while">​</a></h2><p>Go out and meet some people, spend some time with your friends and family. Sometimes you want to go out and have some alone time. Treat yourself with a nice dinner or a movie, all by yourself. Going out of the digital world can help you recharge your mind and re-focus on things. You will get back to your work with a fresh mindset.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="conclusion">Conclusion<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion">​</a></h2><p>Did you find any new tips that can help you be more productive? What is one thing you do to help you get better at code? Feel free to let me know in the comments. While you are reading and sharing this article, I feel I need to get out and apply the last tip. See you next week!</p>]]></content:encoded>
            <category>productivity</category>
        </item>
        <item>
            <title><![CDATA[How to Share Passwords With Your Developer]]></title>
            <link>https://tamalweb.com/share-passwords-with-your-developer</link>
            <guid>https://tamalweb.com/share-passwords-with-your-developer</guid>
            <pubDate>Mon, 22 Apr 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[Sharing your password can put you in a lot of anxiety when working with a developer from sites like Fiverr and Upwork. Sharing passwords with a technical person is a common practice when it comes to outsourcing. But if done incorrectly, your passwords can be exposed to a third party or a hacker.]]></description>
            <content:encoded><![CDATA[<p>Sharing your password can put you in a lot of anxiety when working with a developer from sites like Fiverr and Upwork. Sharing passwords with a technical person is a common practice when it comes to outsourcing. But if done incorrectly, your passwords can be exposed to a third party or a hacker.</p><p>To prevent this, I am going to outline some of the best practices when it comes to sharing passwords with your designer/developer. Especially when you are hiring them on a marketplace such as Fiverr or Upwork.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="give-your-developer-access-to-your-site-without-sharing-the-password">Give your developer access to your site without sharing the password<a href="#give-your-developer-access-to-your-site-without-sharing-the-password" class="hash-link" aria-label="Direct link to Give your developer access to your site without sharing the password" title="Direct link to Give your developer access to your site without sharing the password">​</a></h2><p>Many modern website builders such as Shopify, Wix builder, GoDaddy builder lets you give access to your site to a developer. Shopify even lets the developer build the shop in their own account and then transfer it to yours when the task is complete.</p><p>You just have to enter their username or email in your control panel and they are given developer access to your properties. This eliminates the need to give out your password.</p><p>When working with a self hosted WordPress.org website, you can simply create a new user account. Create the new account with admin privileges, and send that user credentials instead of your main one. Once they are done and handed you over the project, you can just simply delete their user account. This is a very convenient and safer option compared to sharing your password.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-a-password-manager-to-share-your-passwords">Use a password manager to share your passwords<a href="#use-a-password-manager-to-share-your-passwords" class="hash-link" aria-label="Direct link to Use a password manager to share your passwords" title="Direct link to Use a password manager to share your passwords">​</a></h2><p>When you can’t give access without giving them the password, you can use a password manager to do this for you. You can share it using LastPass. The developer will get an email message asking them to accept the share. They must already have a free LastPass account to use it.</p><p>When they accept your password sharing request, they can log in to that appropriate account without having to look at the actual password. This gives you extra security and will bring peace of mind. In fact, one of my client shared their password with me via Lastpass.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="dont-use-the-same-password-for-all-of-your-sites">Don’t use the same password for all of your sites<a href="#dont-use-the-same-password-for-all-of-your-sites" class="hash-link" aria-label="Direct link to Don’t use the same password for all of your sites" title="Direct link to Don’t use the same password for all of your sites">​</a></h2><p>Many internet users use the same password for all their internet accounts. If you expose one of them to a hacker, they will be able to get into all of your internet accounts.</p><p>For this reason you should use different passwords to use on different sites. A password manager such as LastPass can remember these passwords for you.</p><p>I use LastPass as my password manager tool. It has a chrome extension and it auto fills my passwords for various sites. You can generate secure passwords with it. You can also have it memorize all of your passwords.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="some-extra-caution">Some extra caution<a href="#some-extra-caution" class="hash-link" aria-label="Direct link to Some extra caution" title="Direct link to Some extra caution">​</a></h2><p>Often times passwords are shared via instant messages, emails or via text files. These passwords stay on someone’s computer for quite a while. So it’s better to change to a different password as soon as the development project is done.</p><p>Developers don’t usually steal client information, it’s the hackers and viruses which you should be worried about.</p><p>With all these tips I am sure you will be prepared when the next time you hire a freelance website developer.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="your-tasks">Your Tasks:<a href="#your-tasks" class="hash-link" aria-label="Direct link to Your Tasks:" title="Direct link to Your Tasks:">​</a></h2><ul><li>Update your email account, domain and website passwords</li><li>Start using a password manager to generate and store your passwords</li><li>Stop sharing passwords via instant messages</li></ul>]]></content:encoded>
            <category>tips</category>
        </item>
        <item>
            <title><![CDATA[JavaScript Closure Quickly Explained]]></title>
            <link>https://tamalweb.com/javascript-closure-quickly-explained</link>
            <guid>https://tamalweb.com/javascript-closure-quickly-explained</guid>
            <pubDate>Sun, 24 Feb 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[A closure happens when one function is inside another function, and the inner function wants to access a variable which belongs to the outer function.]]></description>
            <content:encoded><![CDATA[<p>A closure happens when one function is inside another function, and the inner function wants to access a variable which belongs to the outer function.</p><p>In JavaScript every function creates its own scope. We may not realize it just by looking at the code, it will help if we visualize it like this:</p><p><img loading="lazy" alt="main" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArwAAAFKCAYAAAD/mYzaAAAABGdBTUEAALGPC/xhBQ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s76F1rvQuttXAvsaO+Rzmazm/jtuWg7Ws7tqc3yMAAAC8YUXNzLnqaj9owbnSa7Y5mNh/t4upswgmrq46t0UsVmSdK8iLnZpgX2Oy0IqxW6F1fn67ZK+Uc0UZAAAA3rCiZuZcBbVLp13y7HLpPNLLcBZgt72tyy2Jzn24C3GuJJvrndsSnN+7cyXZ5nzfatmfwwQAAADesKJmZq/GmpJqOLcv2Kuz9jVmVddwFs3EG8acZdi+3o3z6yx2nbNsJ5Za50py4gqusygv9vkXs9z/LwAAAEivFRVeU+RMobO3BDi3CdirqYnXOPf4Jp6w4NxGYF/vxllkFztlYbFSa39fJomW2u6wHAvtRQYAAEBmrajw2oXO3odrl1l7xddY6BoT5x5dZ4k1WazILvQ5Ei1Wau2Pu62+OgvvYt/HYpxbMxbbYwwAAID0WnbhdZZCu9DZBdPev+u8xl5hda582je6OT9mZ7Ei6yy89iqxKdSJpy3Y1ySW2qUKrfN1+3tcibW+HwAAAKmz7MLrLKk2++/2r/DdrnHubU2MsyguVnjdCrKJs9g69+Emllrn+xO3VRjO79G5Wr1czhvqWN0FAADwlmUXXvv4MbtkOkuivZqbeI3NvO78lb+5zrzfWXidJyq4ce7PdX4Om/PmuMRSa39fJgsV0tWWVuf3tdr9vwAAAEidZRdev3Num1juPl5nyTaFfqnSDgAAgPSj8FqcK9YmS5VX5+q0yUpWhQEAAJA+FF4H5yrvYjefOVd2TRKPQAMAAIB3UHgTOPcauxVZ50MwzL5fyi4AAIC3UXgTmEJrSu9iRdZsZzA35rFnFwAAwPsovAAAAPA1Ci8AAAB8jcILAAAAX6PwAgAAwNcovAAAAPA1Ci8AAAB8jcILAAAAH5P+P4EbLbXVQGEUAAAAAElFTkSuQmCC" width="700" height="330" class="img_ev3q"></p><p>The floor is like the main function scope or the global scope.</p><p>Every time you create a new function, it will be like a bucket.</p><p><img loading="lazy" alt="create new function" src="/assets/images/2-a3338edc247648f3d866c84081317f92.png" width="700" height="330" class="img_ev3q"></p><p>All the variables you create inside that bucket (function) will only be accessible within that bucket only.</p><p>You can create a function inside another function, or to say bucket inside another bucket.</p><p><img loading="lazy" alt="function inside another one" src="/assets/images/3-7eccf84bd126553908bda50670373094.png" width="400" height="400" class="img_ev3q"></p><p>JavaScript likes to execute each of these functions in stack order. It will stack them all on top of each other and the topmost item will be executed first. After that JS will delete the bucket and move on.</p><p><img loading="lazy" alt="js will delete the bucket" src="/assets/images/4-a6baba227dcc96dc06ea64783c091523.png" width="400" height="400" class="img_ev3q"></p><p>For this reason an outer function won’t have access to a variable which was inside another function. Because by the time the function gets its chance, the inner function does not exists anymore.</p><p><img loading="lazy" alt="does not exists anymore" src="/assets/images/5-4a75d0e9febe2857fa0307bbe0e1b923.png" width="400" height="354" class="img_ev3q"></p><p>What happens when there is a variable in a function, which the inner function wants to use?</p><p>JavaScript sees that, and says “<strong>Hold on a sec, you don’t have that variable defined! Don’t go anywhere, let me backtrack and see if your parent function, or any of their parents has it.</strong>” It goes on looking and when it finds the variable, it will now lock the 2 (or more) buckets in its memory. This scope is called a <strong>lexical scope</strong>, or in other words: <strong>a closure in JavaScript</strong>.</p><p><img loading="lazy" alt="accessing values" src="/assets/images/6-271e1f36a9dd17cded74e57b2531986e.png" width="400" height="400" class="img_ev3q"></p><p>After both the inner and outer function is done, and the variable is no longer needed anymore, JavaScript call stack will eliminate them all.</p>]]></content:encoded>
            <category>javascript</category>
            <category>explainer</category>
        </item>
        <item>
            <title><![CDATA[How To Properly Handle Your User’s Passwords]]></title>
            <link>https://tamalweb.com/how-to-properly-handle-your-users-passwords</link>
            <guid>https://tamalweb.com/how-to-properly-handle-your-users-passwords</guid>
            <pubDate>Mon, 07 Jan 2019 00:00:00 GMT</pubDate>
            <description><![CDATA[What do you do with your user’s password? Do you store it into the database?]]></description>
            <content:encoded><![CDATA[<p>What do you do with your user’s password? Do you store it into the database?</p><p>You don’t!</p><p>You should never store the raw password into your application.</p><p>Some badly coded websites store the raw password into their database.</p><p>They store the actual password and even send you via email:</p><p><img loading="lazy" alt="plain text password" src="/assets/images/1-e87829f44a5f6859a2b0ba02b22081b0.png" width="480" height="433" class="img_ev3q"></p><p>This means your password is at risk.</p><p>(by the way, I didn’t code that website, I used a plugin called DAP in WordPress)</p><p>As an app developer, you should not store the actual password into your database.</p><p>And, as a user you should stay away from such sites and inform the webmaster.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="hash-the-password-and-store-it-into-your-database">Hash the password and store it into your database<a href="#hash-the-password-and-store-it-into-your-database" class="hash-link" aria-label="Direct link to Hash the password and store it into your database" title="Direct link to Hash the password and store it into your database">​</a></h2><p>So instead of storing the actual password, you cryptographically hash the password and then store the hash instead of the password.</p><p><img loading="lazy" alt="hash saved in database" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhUAAABqCAYAAAALD6NDAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwwAADsMBx2+oZAAAHC1JREFUeF7tncGvXddVxvsfMGEKQ0aMGCExqZAgygiEVBWFSaOQzkpNM4oprkBUjyoGV63kqBJtBg14UidIdGBRKtGmsYNMFMVITVM7NrXigPWqJLWpY8d2Dv5d+3M+L+993j3P57133/P3k5bPOeusvfbae5+z97rnXZ/7iSGEEEIIYQk+/PDD4fr168ONGzeGmzdvDh999NFCRJKKEEIIISzFpUuXhsuXLw9XrlwZrl27tkgwlFxAkooQQgghLMX58+eHCxcuDOvr64sE4+rVq4vEIklFCCGEECZx8uTJ4dSpU8OZM2eGixcvLhILnljoaUWSihBCCCEsxdGjR4djx44NJ06cGE6fPr14YsGfQvS0IklFCCGEEJbi8OHDw/PPP79ILHhiwZ9C+I5FkooQQgghTGJtbW2RWPDEgj+F8B0L/gTC/wpJUhFCCCGEpTlw4MBw6NCh4ciRI4s/gZw7d254//33k1SEEEIIYRr79+8fDh48uPgTyPHjx4ezZ88mqQghhBDCdJ5++unhmWeeWSQVL7/8cpKKEEIIIWyOJBUhhBBCmIUkFSGEEEKYhSQVIYQQQpiFHUsqPvjgg+Evv/jF4cknnhj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E5ArkCOQO5AzkEucTdpOLKlSvD+vr6cPr06cXjDIzJQni8QeFIJBKJRCIPt5ATkBuQI5ArkDOQO5BD3E0qbt68OVy7dm3x+OLixYvDmTNnFtkHjzUoxBcx+IZnJBKJRCKRh1PIBcgJyA3IEcgVyBnIHcghyCUWSQX/kGFcvXp1cZKsg8cZ/J2EL2AgfLszEolEIpHIwynKB8gNyBHIFcgZyB30lAIWSQUZBkqyDR5j8PcRjPlGZyQSiUQikQhCbkCOQK5AzkDuoKcUi6SCfzhQcnHjxo2FEd/kjEQikUgkEnEhRyBXUDKhhALueU+FTkYikUgkEolsJPcyDP8P7bJiJLKKsh4AAAAASUVORK5CYII=" width="533" height="106" class="img_ev3q"></p><p>If I don’t store the password, then how people are supposed to log back in?</p><p>When someone tries to log in, they will enter their password. You will have to run the hashing function again with that given password. Then you match this new hash with the stored hash.</p><p>When you hash the same password with the same secret key, you will get the same hash string.</p><p>So it will be a match and you know the password was correct and you go ahead and login the user.</p><p>This is why when you forget the password, you don’t get to see the password, instead they send you a link to reset the password. Behind the scenes you are just creating a new hash in the system.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="hash-the-password-with-a-salt">Hash the password with a salt<a href="#hash-the-password-with-a-salt" class="hash-link" aria-label="Direct link to Hash the password with a salt" title="Direct link to Hash the password with a salt">​</a></h2><p>Now normally I would hash the password with a secret key. The problem is, two users may have the same password. Let’s say two users have used 1234 as their password. When your system hashes the password, both user will have the same hash. If your database gets stolen and the hacker sees, those 2 users have the same hash, that means their passwords are the same. This makes things easier for the hacker.</p><p>To fix this, you have to generate a new string which will act as a salt. This salt will also be saved into the database for each user. Each of these salts will be unique per user.</p><p>So next, instead of hashing the password with a secret key, you use the salt to hash the password. That way now you will get a unique hash per user.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="code-examples">Code examples:<a href="#code-examples" class="hash-link" aria-label="Direct link to Code examples:" title="Direct link to Code examples:">​</a></h2><p>Here’s how I created a salt using the crypto module in Node.js:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> crypto </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">require</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'crypto'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(220, 220, 170)">createTheSalt</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain"> crypto</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">randomBytes</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token number" style="color:rgb(181, 206, 168)">20</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">toString</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'hex'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>And here I’m using the salt and the given password to hash the password:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> crypto </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">require</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'crypto'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> </span><span class="token function-variable function" style="color:rgb(220, 220, 170)">hashThePassword</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(86, 156, 214)">function</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">password</span><span class="token parameter punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token parameter"> salt</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  password </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    password</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">length</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">&amp;&amp;</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(86, 156, 214)">typeof</span><span class="token plain"> password </span><span class="token operator" style="color:rgb(212, 212, 212)">===</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'string'</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">?</span><span class="token plain"> password </span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token keyword nil" style="color:rgb(86, 156, 214)">undefined</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">password </span><span class="token operator" style="color:rgb(212, 212, 212)">&amp;&amp;</span><span class="token plain"> salt</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token comment" style="color:rgb(106, 153, 85)">// Create the salt</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> hash </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> crypto</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">      </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">createHmac</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'sha512'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> salt</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">      </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">update</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">password</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">      </span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">digest</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'hex'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token comment" style="color:rgb(106, 153, 85)">// Return a salt and hash object</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> salt</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> hash </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">else</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">return</span><span class="token plain"> </span><span class="token keyword null nil" style="color:rgb(86, 156, 214)">null</span><span class="token punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>So the next time you come across a website which sends your actual password when you forgot the password, know that your data is in wrong hands.</p>]]></content:encoded>
            <category>nodejs</category>
            <category>javascript</category>
        </item>
        <item>
            <title><![CDATA[Specializing in JavaScript]]></title>
            <link>https://tamalweb.com/specializing-in-javascript</link>
            <guid>https://tamalweb.com/specializing-in-javascript</guid>
            <pubDate>Mon, 05 Nov 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[For the last few weeks I have taken a deep dive into the JavaScript programming language. Earlier this year I decided to work with Node.js so that I can work on just one language for the front end and the back.]]></description>
            <content:encoded><![CDATA[<p>For the last few weeks I have taken a deep dive into the JavaScript programming language. Earlier this year I decided to work with Node.js so that I can work on just one language for the front end and the back.</p><p>I am now going in deep with JS. It’s fun.</p><p>I am following this collection of <a href="https://github.com/leonardomso/33-js-concepts" target="_blank" rel="noopener noreferrer">33 Concepts in JS</a> which is really helping me a LOT. I am tackling about one concept a day. One thing leads to another and I am spending most of my YouTube hours watching JS related videos and reading articles.</p><p>Staying focused in one language is helping me learn it quicker and soon I will become a master of it.</p><p>It’s not very easy to focus you know, every week I think about checking out another language. Languages like Go, Python, Kotlin, teases me in my YouTube feed.</p><p>There are some weird parts of JavaScript, which sometimes turn me off, but then again when I learn a new concept I get back up at it. I am glad I did not quit Node.js when I was getting bored with it.</p><p>As I mentioned before, I am not a big fan of JavaScript and predict it will be replaced in the near future. But until that time comes up (maybe in 5-10 years) why not be really good at it while it’s thriving?</p>]]></content:encoded>
            <category>javascript</category>
            <category>opinion</category>
        </item>
        <item>
            <title><![CDATA[Thoughts after Building a Reddit Clone in MERN (Node & React)]]></title>
            <link>https://tamalweb.com/thoughts-after-building-a-reddit-clone-in-mern-node-react</link>
            <guid>https://tamalweb.com/thoughts-after-building-a-reddit-clone-in-mern-node-react</guid>
            <pubDate>Sat, 22 Sep 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[So last week I put together a reddit like site, a clone of reddit as you can say. This is my first MERN stack application I am putting out to the world. I pretty much did a rush work and cut a lot of corners, just to get it out there and see how it goes.]]></description>
            <content:encoded><![CDATA[<p>So last week I put together a reddit like site, a clone of reddit as you can say. This is my first MERN stack application I am putting out to the world. I pretty much did a rush work and cut a lot of corners, just to get it out there and see how it goes.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="features">Features<a href="#features" class="hash-link" aria-label="Direct link to Features" title="Direct link to Features">​</a></h2><p>A user can get a display name. This time I did not use any user registration mechanism. This also lead to some spam, which I will share in the rest of this post.</p><p>The user can post something and vote up and down. Users can vote as many times as she wants, again some lazy coding.</p><p>It was more like a prototype of how the app would look and feel like. I didn’t do much work in the backend other than connecting the database.</p><p>So I was happy to put it out there, hosting it on heroku.</p><p>Both my front end client code and backend server code is hosted on Heroku. After deploying I was getting a ‘Not Found’ error.</p><p>After some digging, I found that the ‘build’ folder in the react app gets ignored by default in the gitignore file. So I put that backup and now my app it up!</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="some-thoughts-after-publishing-it-online">Some thoughts after publishing it online:<a href="#some-thoughts-after-publishing-it-online" class="hash-link" aria-label="Direct link to Some thoughts after publishing it online:" title="Direct link to Some thoughts after publishing it online:">​</a></h2><p>Using it on localhost vs actual live deployment has day and night difference.</p><p>The app loads the posts after it publishes into the database, so this makes the app lose its react-ness. So in future work I will post the data to the state first, so when someone submits a post it gets displayed instantly and then sent to the database in the background.</p><p>The site needs a loading indicator. Currently, the page stays dumb for a few seconds until all the post gets loaded.</p><p>When I shared the site with the dev community, people started to spam the site. This is the first time I went to a headless approach. My backend gets data pushed to it via REST API’s. I did not secure my API’s this means anyone can send a request to it and manipulate the database. This + not having any validations led to a lot of post spam.</p><p>After a few days I dig into the code and added some validation mechanisms to the code.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments:<a href="#comments" class="hash-link" aria-label="Direct link to Comments:" title="Direct link to Comments:">​</a></h2><p><strong>Christophe:</strong> Hi Tamal,
Reading your awesome blogposts.
I following the same way as you. Learning the basics from a lot of (web)languages (html,css,JS,php,perl,Sass,…) and have experience with a lot of cms’systems like processwire, Drupal, Get Simple CMS, GRAV CMS, … the last 3 years Building WP websites and do small theme and plugin development work.
I’m not an advanced programmer, but is difficult focus on one programming language.
In the feature i will try do a different thing and will do more developing webapps. So with this in mind, trying learn NodeJS the last weeks.
Searching the internet about NodeJS articles, bought a book about NodeJS and looking a lot of NodeJS video’s. At the moment i can build a (more advanced) ‘hello world’ app in NodeJS. I understand now what MEAN-stack is and other basic stuff. Explore the Express Generator and so on. But, there is a lot of work for me while developing like a pro. So i follow your blog with a lot of interest. Last but not least, sorry for my poor English ?
Grtz from Belgium 😉</p><blockquote><p>All the best Chris, try to stick to one language/tech. Node is very good, but it can be overwhelming. Just keep on grinding and building stuff.</p></blockquote>]]></content:encoded>
            <category>project</category>
            <category>nodejs</category>
        </item>
        <item>
            <title><![CDATA[Finally I got to Build a MERN Stack Application!]]></title>
            <link>https://tamalweb.com/finally-i-got-to-build-a-mern-stack-application</link>
            <guid>https://tamalweb.com/finally-i-got-to-build-a-mern-stack-application</guid>
            <pubDate>Sun, 16 Sep 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[For those who don’t know, MERN stands for Mongo database, Express framework, React.js framework and Node.js runtime environment. Together they create a software stack for building custom web application.]]></description>
            <content:encoded><![CDATA[<p>For those who don’t know, MERN stands for Mongo database, Express framework, React.js framework and Node.js runtime environment. Together they create a software stack for building custom web application.</p><p>Now that’s all the technical stuff, let me share what’s exactly I mean by all this..</p><p>So I know how to make simple websites with HTML and CSS. But the problem is, those sites are dumb, they don’t do anything.</p><p>If I wanted to make it more than a website, I needed to make it more dynamic. Like adding option for user registration. Give option to add content, comment on it. Do something with the input etc.</p><p>For many years, I used WordPress to build basic dynamic websites. However WordPress is very limited to what you can do with it.</p><p>To turn a WordPress site into a social website, I had to install a lot of plugins and do a lot of theme modifications. At the end of the day, it’s a hard thing to do, since WP was originally built to do one thing.</p><p>So I knew, if I wanted to build a true web application, I had to go to the custom route.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="enter-react">Enter React<a href="#enter-react" class="hash-link" aria-label="Direct link to Enter React" title="Direct link to Enter React">​</a></h2><p>React is a user facing front end framework to build cool web pages/web applications. I fell in love with react because you can do something on the page and get the result without having to refresh the browser.</p><p>It can even process the data without you having to press a submit button, see:</p><p>So it turns out, with simple react I can just create a bunch of todo style apps.</p><p>I realized that, react is not enough to build a full web application. It’s just the front layout of the complete app.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="enter-node">Enter Node<a href="#enter-node" class="hash-link" aria-label="Direct link to Enter Node" title="Direct link to Enter Node">​</a></h2><p>Node lets me make user registration option, ability to login, then submit content and all that cool stuff. I learned how to build a web app by building a simple Twitter clone app last season.</p><p>In that article I mentioned, I am not fully satisfied the way it’s turned out. It needs the reactness.</p><p>So this means I have to combine the magic of React with the power of Node.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="here-comes-mern">Here Comes MERN<a href="#here-comes-mern" class="hash-link" aria-label="Direct link to Here Comes MERN" title="Direct link to Here Comes MERN">​</a></h2><p>It was a long lasting dream of mind to build a full stack app with Node in the backend and React on the front. I finally built a project called Reddit Clone, this time it’s a MERN app.</p><p>How long it took me? Roughly 6 months, from Node, then React and finally MERN stack.</p><p>Yeah baby, I am now a MERN stack developer.</p><p>So what’s next?</p><p>Let’s build more awesome stuff!!</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments:<a href="#comments" class="hash-link" aria-label="Direct link to Comments:" title="Direct link to Comments:">​</a></h2><p><strong>Navdeep Singh</strong>: I can feel your excitement. Kudos to you bro. Keep it up.
~ Stay Foolish, Stay Focused.</p>]]></content:encoded>
            <category>nodejs</category>
            <category>reactjs</category>
        </item>
        <item>
            <title><![CDATA[Node.js is like My Wife and I am Getting Bored with Her :(]]></title>
            <link>https://tamalweb.com/node-js-is-like-my-wife-and-i-am-getting-bored-with-her</link>
            <guid>https://tamalweb.com/node-js-is-like-my-wife-and-i-am-getting-bored-with-her</guid>
            <pubDate>Thu, 06 Sep 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[As funny and absurd as it sounds, I think it’s a similar feeling. I chased node, I tried to figure it out. I dreamt of building stuff with node. Eventually I figure it out. I learned how to build stuff with it. Then slowly I got bored with it. Looks like the honeymoon period is over 🙁]]></description>
            <content:encoded><![CDATA[<p>As funny and absurd as it sounds, I think it’s a similar feeling. I chased node, I tried to figure it out. I dreamt of building stuff with node. Eventually I figure it out. I learned how to build stuff with it. Then slowly I got bored with it. Looks like the honeymoon period is over 🙁</p><p>This is actually an interesting take on learning code.</p><p>And this also happened with me when learning other languages!</p><p>If you read my other stuff, you will know that I went from one language to another to finally settle down with JavaScript.</p><p>For the other languages that I tried, Java, Python, PHP and Ruby, I didn’t got to build anything with them. I could not fully understand those tech and kinda lost interest.</p><p>Now with Node, the same thing happened in the beginning, but I said to myself, if I quit now, I will feel the same with yet another language down the road.</p><p>So I went with it anyway and got passed the hard learning curve.</p><p>Now recently I am fairly proficient with Node.js and all it takes for me is to put some work to build an application.</p><p>But the process kinda bores me.</p><p>I looked into other novelty, like another computer language.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="looking-into-c-c-tutorials">Looking into C, C++ Tutorials<a href="#looking-into-c-c-tutorials" class="hash-link" aria-label="Direct link to Looking into C, C++ Tutorials" title="Direct link to Looking into C, C++ Tutorials">​</a></h2><p>So last evening I went online and look into some C and C++ tutorials. I went through some intro level stuff and I felt the same excitement the way I felt with intro level node stuff. The brain seeks new. There is a happiness trying to figure out something new.</p><p>Then I looked into a game developer building a game from scratch.</p><p>Then I realized..</p><p>The pain of building something with C++ is no different than building with Node.</p><p>No matter what language or tech you choose, after going past the easy stuff, you will have to keep on grinding.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="short-term-excitement-vs-long-term-fulfillment">Short term Excitement vs long term Fulfillment<a href="#short-term-excitement-vs-long-term-fulfillment" class="hash-link" aria-label="Direct link to Short term Excitement vs long term Fulfillment" title="Direct link to Short term Excitement vs long term Fulfillment">​</a></h2><p>I know Node, but that’s just barely scratching the surface. There is so much more to learn about the Node runtime and JavaScript. If I just give it another chance, I can see what more is out there in this technology.</p><p>Yeah looking into a new language/tech can give me a small boost of excitement, but true happiness comes from building software that people really use and enjoy.</p><p>So Tamal, don’t fall into the trap of seeking novelty in yet another shiny new thing. Stick to Node + JavaScript until you fully master it.</p><p>I’m sure you won’t regret it!</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments:<a href="#comments" class="hash-link" aria-label="Direct link to Comments:" title="Direct link to Comments:">​</a></h2><p><strong>Ali</strong>: This is so true
Thanks for sharing your experience
Your words resonated very well with me
I myself am learning node but couldn’t get my head around JavaScript
It has been a month in and I’m not comfortable at all with the syntax and concepts
But I guess I should grind and go on</p><blockquote><p>Tamal: Hi Ali, thanks for dropping by. If you want to work on the web, then JavaScript will help you a lot, so keep on grinding.
However since you are new to code, you can try out different things until you find one that best suits you.</p></blockquote>]]></content:encoded>
            <category>opinion</category>
            <category>nodejs</category>
        </item>
        <item>
            <title><![CDATA[Thoughts After Building a Twitter Clone in Node.js]]></title>
            <link>https://tamalweb.com/thoughts-after-building-a-twitter-clone-in-node-js</link>
            <guid>https://tamalweb.com/thoughts-after-building-a-twitter-clone-in-node-js</guid>
            <pubDate>Mon, 27 Aug 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[Last season I built a twitter clone in Node.js. It’s a social media web application built with Node.js, Express, Mongoose and Passport.js.]]></description>
            <content:encoded><![CDATA[<p>Last season I built a twitter clone in Node.js. It’s a social media web application built with Node.js, Express, Mongoose and Passport.js.</p><p>I deployed the app into a live server in Heroku, making it my first live Node/Express app.</p><p><img loading="lazy" alt="twitter clone" src="/assets/images/1-498eade23b8144312056e3ec06519e68.jpg" width="1208" height="906" class="img_ev3q"></p><p>I first shared the link onto the Node.js Facebook group for feedback. I also asked people not to attack it.</p><p>Here’s the app in action: <a href="https://www.youtube.com/watch?v=fMIU9cG4qmw" target="_blank" rel="noopener noreferrer">https://www.youtube.com/watch?v=fMIU9cG4qmw</a></p><p>So after launching the site, so many things I realized for the first time. Let me start with the positive first:</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-positive">The Positive<a href="#the-positive" class="hash-link" aria-label="Direct link to The Positive" title="Direct link to The Positive">​</a></h2><p>The twitter clone app gave me confidence as a newbie web developer. This is the first time I built a full stack web application without WordPress. I got lots of positive feedback for this project.</p><p>I was taking the Node course from Wes Bos. The final chapter showed how to deploy the app on the internet. After learning it, I quickly built out this twitter clone app and put it out.</p><p>I am especially fond of the design of the app. I did this design with vanilla CSS with the pug template engine.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-negative">The Negative<a href="#the-negative" class="hash-link" aria-label="Direct link to The Negative" title="Direct link to The Negative">​</a></h2><p>For starters, the app I built is super slow. This probably because I am using free web hosting from Heroku and a free tier database from mlab.</p><p>Also for every request, I make (creating a tweet) the app reloads the page. All this makes the user experience laggy. I would call it the very early version of the original twitter site, and not a complete twitter clone.</p><p>After a while, all the profile pictures disappear. This is probably because Heroku does not allow image hosting. My app also has some security flaws which I have to learn and implement into the next projects.</p><p>My site is not mobile responsive either. I just wanted to put it up online as quickly as possible. From next time on, I will go with mobile-first approach.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="after-twitter-clone">After Twitter Clone<a href="#after-twitter-clone" class="hash-link" aria-label="Direct link to After Twitter Clone" title="Direct link to After Twitter Clone">​</a></h2><p>After finishing the Node course (and the twitter clone) I took some break from Node.js. I went on and took another course for React.js. I spent some time learning React, as my end goal is to build web apps with the MERN stack (Mongo, Express, React &amp; Node)</p><p>I spent a few weeks with React, building a few small apps. Then lately I reunited again with Node.js. This time I am building apps with Node and React combined.</p><p>The idea is to build the backend API with Node/Express and the front-facing user interface with React.</p><p>So this means if I refactor the twitter clone in React, then I will be able to make it respond faster (like realtime).</p><p>I also need to learn more about test-driven development so I can make better apps.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="verdict">Verdict<a href="#verdict" class="hash-link" aria-label="Direct link to Verdict" title="Direct link to Verdict">​</a></h2><p>So looks like I am not happy with my creation, that’s one reason it took me so much time to write about it. It’s actually a positive thing, this means my expectations are much higher. I just have to work on honing my skills and keep on building. Here’s the Github repo.</p>]]></content:encoded>
            <category>nodejs</category>
            <category>projects</category>
        </item>
        <item>
            <title><![CDATA[Why I am not a Fanboy of JavaScript]]></title>
            <link>https://tamalweb.com/why-i-am-not-a-fanboy-of-javascript</link>
            <guid>https://tamalweb.com/why-i-am-not-a-fanboy-of-javascript</guid>
            <pubDate>Sat, 25 Aug 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[JavaScript, I like it, I love to build things with it, but I am not a fanboy. JS is the de facto language of the web. The web browsers only understands JavaScript. For this reason, web developers all around the globe has to learn this language.]]></description>
            <content:encoded><![CDATA[<p>JavaScript, I like it, I love to build things with it, but I am not a fanboy. JS is the de facto language of the web. The web browsers only understands JavaScript. For this reason, web developers all around the globe has to learn this language.</p><p>I chose Node.js to build the backend of my web application, just so that I can use a single language to build both the front and the back.</p><p>I am not a fanboy of this language, and neither should you.</p><p>In fact you should not be a fanboy of any given language, framework or technology.</p><p>The thing is, technology changes over time.</p><p>Being blindly in love with a technology will make you biased towards it. You won’t see its flaws. If you truly want to learn JavaScript, start using it. Know what it can do, what its limitations are.</p><p>Use it as a tool.</p><p>My passion is to build useful web applications, not to code in JavaScript.</p><p>In the past there were cool languages which got replaced by C and C++. Soon these languages are going to be replaced by modern languages like Python, Go, Kotlin. Look into the future, JavaScript WILL be replaced by better technologies, it’s inevitable.</p><p>So instead of being a fanboy, learn to become a really good software engineer. And once the time comes for the switch, you can take all your software building expertise you learned from JavaScript and apply onto the next thing.</p>]]></content:encoded>
            <category>javascript</category>
            <category>opinion</category>
        </item>
        <item>
            <title><![CDATA[Deleting an Item From MongoDB Mongoose By User Permission]]></title>
            <link>https://tamalweb.com/deleting-an-item-from-mongodb-mongoose-by-user-permission</link>
            <guid>https://tamalweb.com/deleting-an-item-from-mongodb-mongoose-by-user-permission</guid>
            <pubDate>Thu, 07 Jun 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[The first thing you learn when building a web application is CRUD, Create Read, Update and Destroy. I was learning Node.js to build the backend of my application. The first few lessons were about creating data, and then editing it.]]></description>
            <content:encoded><![CDATA[<p>The first thing you learn when building a web application is <strong>CRUD</strong>, Create Read, Update and Destroy. I was learning Node.js to build the backend of my application. The first few lessons were about creating data, and then editing it.</p><p>In MongoDB mongoose, there are some handy commands for creating, editing items. Let’s say I have a blog post which I created. To edit it, I call the <code>.findOneAndUpdate()</code> method for editing the existing collection.</p><p>I soon figured out there must be a <code>.removeOne()</code> or <code>.deleteOne()</code> method to delete an item from the database collection.</p><p>I gave that a try.</p><p><img loading="lazy" alt="deleting post" src="/assets/images/1-d3a03f7d5cdbfc3ab5669fb895f9db37.png" width="648" height="503" class="img_ev3q"></p><p>I created a controller to delete a collection, with some trial and error I was able to figure out the command for deleting a blog post is running the <code>.deleteOne()</code> method on my Blog object.</p><p>In my router, I used a GET method for this delete option. Anytime I call the delete route, the post with that ID will be deleted.</p><p>This week I am building a twitter clone with Node.js. Here I have a bunch of tweets posted by bunch of users.</p><p>Now here’s the problem, anyone can delete a tweet with the delete button, even the people who are not even logged in.</p><p>You can type in the <code>Site.com/delete/5b16d5ac27542f10343e2717</code> and can manually delete any tweet from the database, because it’s a <code>GET</code> request.</p><p>To fix this issue, I added a controller to check if the user is logged in to complete this action.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">router</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">get</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token string" style="color:rgb(206, 145, 120)">'/delete/:id'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  authController</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">isLoggedIn</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  tweetController</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">deleteTweet</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Okay, now only the logged in users can delete a tweet. But the problem was still there, anyone can delete any tweet.</p><p>So I have to use a permission for deleting. Only allow the owner of that tweet to be able to delete it.</p><p>I modeled this code after Wes Bos’ LearnNode course. In video #29 he shows how to display the edit screen only to the owner of that store.</p><p>The code looks like this:</p><p><img loading="lazy" alt="code" src="/assets/images/3-5a6c35e6b220ca822bd75b637a1251f5.png" width="665" height="379" class="img_ev3q"></p><p>So first I load up the store from the database and check for if the user actually owns the store. If the user owns the store, only then I will render the edit store page.</p><p>However this won’t work with the delete action. You see if I call .deleteOne()﻿, then the tweet will be already deleted.</p><p>So instead I called the tweet first and then checked if the user owned that tweet.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token plain">exports</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method-variable function-variable method function property-access" style="color:rgb(220, 220, 170)">deleteTweet</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(86, 156, 214)">async</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token parameter">req</span><span class="token parameter punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token parameter"> res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token arrow operator" style="color:rgb(212, 212, 212)">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">try</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> tweet </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">await</span><span class="token plain"> </span><span class="token maybe-class-name">Tweet</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">findOne</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> </span><span class="token literal-property property">_id</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> req</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">params</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">id</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">if</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token operator" style="color:rgb(212, 212, 212)">!</span><span class="token plain">req</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">user</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">username</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">===</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'tamal'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">      </span><span class="token function" style="color:rgb(220, 220, 170)">confirmedOwner</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">tweet</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> req</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">user</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> deleteTweet </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">await</span><span class="token plain"> </span><span class="token maybe-class-name">Tweet</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">deleteOne</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">tweet</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">redirect</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'back'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:rgb(86, 156, 214)">catch</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">e</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token console class-name" style="color:rgb(78, 201, 176)">console</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">log</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token plain">e</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    res</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">redirect</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'/?msg=Failed to delete'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Once he/she is a verified owner, only then run the next command which is deleting the tweet.</p><p>This made things bulletproof for now. Only the logged in users, who actually owned the tweet can delete it.</p><p>The final step was to only show the “Delete” link to the owner of that tweet.</p><p><img loading="lazy" alt="delete link" src="/assets/images/5-b2c063e34e4e3aa3193706542f0f62f9.png" width="619" height="399" class="img_ev3q"></p>]]></content:encoded>
            <category>nodejs</category>
        </item>
        <item>
            <title><![CDATA[Things I Learned While Building a Personal Project]]></title>
            <link>https://tamalweb.com/things-i-learned-while-building-a-personal-project</link>
            <guid>https://tamalweb.com/things-i-learned-while-building-a-personal-project</guid>
            <pubDate>Mon, 28 May 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[Last week I ran into a real world problem.]]></description>
            <content:encoded><![CDATA[<p>Last week I ran into a real world problem.</p><p>It’s hard to keep track of my washed and dirty clothes. I have no idea how long it’s been since last wash. So I needed to track them by making a list and counting the dates.</p><p><img loading="lazy" alt="laundry list" src="/assets/images/1-e0822a16b8f9ce78116f04a1c2f86b30.png" width="700" height="482" class="img_ev3q"></p><p>The first idea is obviously writing them down on paper, but then I thought why not use my JavaScript skills to build an app to track it?</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-initial-idea">The initial idea:<a href="#the-initial-idea" class="hash-link" aria-label="Direct link to The initial idea:" title="Direct link to The initial idea:">​</a></h2><p>It’s a one page app with a To-Do list kind of functionality. I want to be able to add and remove items. In this context, my items are the clothes.</p><p>I also want to add a date into that clothe and count how many days have been passed.</p><p>Doing a quick google search revealed that there is a Date object in JavaScript which I can tap into.</p><p>So for every clothe, I attached the current date into it.</p><p>I created an array of objects. Each object being the item of clothing that has an item text and a date field.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> sampleData </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> </span><span class="token literal-property property">text</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Sample Item'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token literal-property property">date</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'2018-05-21T14:53:18.883Z'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token literal-property property">done</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">  </span><span class="token punctuation" style="color:rgb(212, 212, 212)">{</span><span class="token plain"> </span><span class="token literal-property property">text</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Another Sample'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token literal-property property">date</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'2018-05-21T14:53:26.899Z'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"> </span><span class="token literal-property property">done</span><span class="token operator" style="color:rgb(212, 212, 212)">:</span><span class="token plain"> </span><span class="token boolean">false</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">}</span><span class="token punctuation" style="color:rgb(212, 212, 212)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>For now I just need these two things.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="tracking-how-many-days-passed">Tracking how many days passed<a href="#tracking-how-many-days-passed" class="hash-link" aria-label="Direct link to Tracking how many days passed" title="Direct link to Tracking how many days passed">​</a></h2><p>In my mind I thought I had to do some calculations and save the new data in a new field for how many days passed. Then I remembered, there is a cool library called Moment.js.</p><p>If I put the date into the moment function, it will show a nice little relative time like <strong>2 days ago</strong> or <strong>7 days from now.</strong></p><p>So I quickly implemented momentjs into my application. This saved me a lot of work trying to calculate the relative days.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="saving-the-data">Saving the data<a href="#saving-the-data" class="hash-link" aria-label="Direct link to Saving the data" title="Direct link to Saving the data">​</a></h2><p>So for an application like this, the data has to be stored somewhere. I can’t just open the app, add items and when I refresh the page it’s all gone.</p><p>I know how to add data into database, but for that I will need to make it into a Node.js app with MongoDB and specialized web hosting. It’s just a side project, I don’t want to go in all the trouble for this.</p><p>I searched online and found there is an api called localStorage.</p><p>So with localStorage you can save some text data into a user’s browser.</p><p>This is just the thing I need for my app. So I went ahead and look into ways to implement it.</p><p>So when I add items into my list, it will be stored in my web browser as local storage.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="making-it-work">Making it work<a href="#making-it-work" class="hash-link" aria-label="Direct link to Making it work" title="Direct link to Making it work">​</a></h2><p>I coded the basic implementation of the app, but I was running into problems. The main problem I faced was, I created a variable called “items” and this variable contained the array of objects. The object was grabbed from the local storage.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> items </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token known-class-name class-name" style="color:rgb(78, 201, 176)">JSON</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">parse</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token dom variable" style="color:rgb(156, 220, 254)">localStorage</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">getItem</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'items'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>But when you open the app for the first time, there is no local storage and no data in that variable, this led to huge problems.</p><p>I found Wes Bos had a <a href="https://www.youtube.com/watch?v=YL1F4dCUlLc" target="_blank" rel="noopener noreferrer">dedicated video tutorial</a> on localStorage api. I looked into the tutorial and it helped a lot to build out my app. His walkthrough helped build this app in a much more efficient way.</p><p>So to solve my initial problem, I set my items variable to the data found from localStorage. But when there is no local storage, it will fall back to an empty array <!-- -->[ ]<!-- -->.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">const</span><span class="token plain"> items </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token known-class-name class-name" style="color:rgb(78, 201, 176)">JSON</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">parse</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token dom variable" style="color:rgb(156, 220, 254)">localStorage</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">getItem</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'items'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">||</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(212, 212, 212)">[</span><span class="token punctuation" style="color:rgb(212, 212, 212)">]</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="designing-the-frontend--putting-it-all-together">Designing the frontend &amp; putting it all together<a href="#designing-the-frontend--putting-it-all-together" class="hash-link" aria-label="Direct link to Designing the frontend &amp; putting it all together" title="Direct link to Designing the frontend &amp; putting it all together">​</a></h2><p>After my app was working as I wanted, I went on to my favorite part: the design. I worked a few hours to come up with a sleek user interface.</p><p>I built the items into an ordered list, so they come with numbers.</p><p>I did some CSS work to make the app look pretty.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="making-it-general-purpose">Making it general purpose<a href="#making-it-general-purpose" class="hash-link" aria-label="Direct link to Making it general purpose" title="Direct link to Making it general purpose">​</a></h2><p>I built this glorified ToDo list to track my laundry, but not everyone will be using it for the same purpose. So I went ahead and made it more “general”</p><p>I made the title into something which the user can change.</p><p><img loading="lazy" alt="change the title" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkoAAACkCAYAAABo8gFCAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACDiSURBVHhe7Z3/axzX3e/zZ+yvhv4S6A8N+sFeKM1j0RQ/vjgPtfBDYhKMEUlI1DZtRHrjCOWpjeIEdbEvsZvEYQlOiGTseG3y+MtVzZXJJXQN11ThiUHGOJWK01gNwneLdWvFtdPPPWd2Z/fMmTk7Z7VfPJJeL3iFWDs7O3Pm7DnvOTtz5qEz/+fvgoiIiLge/cc//iH37t2T+/fvy3fffSf//Oc/A0MISoiIiLhuvX37tiwtLcmdO3fk7t27QWgKAxNBCREREde1N27ckK+//loWFxeD0PTtt98GYYmghIiIiOvey5cvyxdffCFffvmlfPPNN0FY0iNL4agSQQkRERHXraVSSaampuTSpUty/fr1YGRJ/wwXjioRlBAREXHd+vbbb8tHH30UhCU9sqR/htPXLBGUEBERcd37xhtvBGFJjyzpn+H0NUv65zd9N1zHghIAAADAauS1116TgwcPyrFjx4Kf3+bn5+Vvf/sbQQkAAADg1VdflUKhEPz8Vi6XZW5ujqAEAAAAoNmzZ4/89re/DYLSH/7wB4ISAAAAQAhBCQAAAMBBx4PSB+e+jAkAAACwGiEoAQAAADggKAEAAAA4ICgBAAAAOCAoAQAAADggKAEAAAA4ICgBAAAAOCAoAQAAADggKAEAAAA4ICgBAAAAOCAoAQAAADggKAEAAAA4ICgBAAAAOCAoAQAAADggKAEAAAA4ICgBAAAAOCAoAQAAADggKAEAAAA4ICgBAAAAOCAoAQAAADggKAEAAAA4ICgBAAAAOCAoAQAAADggKAEAAAA4ICgpzv6XyOQlREREzIK6X84K6z4o6YOx95N/Jh4oRERE7L26X85KWFr3QSk8KAAAAJANst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k0+z0UhERFzVEpQQ21CPdDQdjURExFUtQQkRERHRIUEJERER0SFBCREREdEhQQkRERHRIUEJERER0eGrr74qhUIhCErlcpmghIiIiBj62muvycGDB+XYsWNy6dIlmZ+fjwYl/T+3b9+WGzduyOXLl6VUKsnbb78tb7zxRvBmnbT0sBQiIiLiWlHnG51zdN7RuUfnH52DdB7SuagelO7duydLS0vy9ddfyxdffCFTU1PB8JN+k05Y+nc7RERExLWmzjk67+jco/OPzkE6D+lcpPNRPSjduXNHFhcX5fr168Gwk15YJys9DKXfjIiIiLjW1DlH5x2de3T+0TlI5yGdi+pBSV8zdPfu3WCYSV8v9OWXXwaJSg8/6TfpC5v0VeCIiIiIa0Wdb3TO0XlH5x6df3QO0nlI5yKdj4KgpP+jU9O3334bvKiTlB520r/R6QuatPoia0RERMS1YphxdN7RuUfnH52DdB4KR5M0QVDSqUn/UScoPdykf5vTC+urvhERERHXqjrv6Nyj84/OQToPhaNJQVDS/9H/CAPT/fv3g4X01d6IiIiIa12de3T+CQNSGJI0QVAKCV9EREREXI9GEfn/L38RCZcOPbYAAAAASUVORK5CYII=" width="586" height="164" class="img_ev3q"></p><p>I made the title into a form field and when the user clicks on it, he/she can change it to something else.</p><p>I also made the website title tag into the title of the app and also saved it into local storage.</p><p><img loading="lazy" alt="website title tag" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAABQCAYAAACNr2npAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABFWSURBVHhe7Z2LcxRFHsfz111dFXeVu/NxyFOeIhgULniQcCHIY08IRAUTQRPkIZvcJQIKHhhWOYSsGgkKVagVDhQOwuNEhSoKBOybb8/0bM/0b2Znk9nZnc3vV/WB3enumZ6Z/n3SszuT1H28ebFgGIZJI7/88ot48OCBePjwoXj06JH49ddfJSpYcAzDpJbbt2+LO3fuiLt374r79+9L2SnRseAYhkk1ly5dEleuXBE3b96Usrt3756UHAuOYZjUMzQ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aR4qw4iY9qExwzBMtQE/wVPwFbwFf8Fj8JkruEePHon79+/Lad3169fF+fPnpQkx3UMjfHCHbycYhmGqBXgJfoKn4Ct4C/6Cx+AzeE0KDv/Advfu3ZOFMCCmebiWxQd2AN9MMAzDVAvKTfAUfKV+2zY8pmZvCCk42A4LYT5M73ANi8r4NoJhGKZagafgK3gL/oLH1OxNCg7/4I0SHe7FQiV8C8EwDFPtwFfwlhKbkhtCCk6FKmQYhkkj3hDi/5F7x6oKuVy5AAAAAElFTkSuQmCC" width="312" height="80" class="img_ev3q"></p><p>I did it by setting the document.title property to my variable:</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token comment" style="color:rgb(106, 153, 85)">// 1. Getting the title from local storage OR fallback to default title</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">let</span><span class="token plain"> title </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token dom variable" style="color:rgb(156, 220, 254)">localStorage</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">getItem</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'localTitle'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">||</span><span class="token plain"> </span><span class="token string" style="color:rgb(206, 145, 120)">'Laundry List ✎ Edit this!'</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// 2. Getting the title from the form</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token dom variable" style="color:rgb(156, 220, 254)">document</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">querySelector</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'[name=title]'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">value</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> title</span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token comment" style="color:rgb(106, 153, 85)">// 3. Setting the document title tag</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token dom variable" style="color:rgb(156, 220, 254)">document</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token property-access">title</span><span class="token plain"> </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> title</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="final-thoughts">Final thoughts<a href="#final-thoughts" class="hash-link" aria-label="Direct link to Final thoughts" title="Direct link to Final thoughts">​</a></h2><p>I had fun working on this little thing. It’s really useful too! I am using it to properly track my laundry.</p><p>I am also going to work on a portable mobile version, so people can use it offline and in mobile too.</p><p>This little side project taught me so many new things. You can check out the <a href="https://tamalweb.github.io/ClothesWashTracker/" target="_blank" rel="noopener noreferrer">finished version over here</a>.</p>]]></content:encoded>
            <category>javascript</category>
            <category>project</category>
        </item>
        <item>
            <title><![CDATA[Quitting is important]]></title>
            <link>https://tamalweb.com/quitting-is-important</link>
            <guid>https://tamalweb.com/quitting-is-important</guid>
            <pubDate>Mon, 21 May 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[We have limited hours everyday.]]></description>
            <content:encoded><![CDATA[<p>We have limited hours everyday.</p><p>In any given day, we can’t always utilize every hour of the day. To get the most done, you must quit many things. You must quit projects, say “<strong>NO</strong>” to things, so you can succeed at your goals.</p><p>We are always being reminded not to quit, just go for it, just do it. Any motivational seminar, video or quote tells us to never quit.</p><p>But does this kind of motivation really works?</p><p><strong>It doesn’t, here’s why:</strong></p><p>I was your average highly motivated productive person. I would get done many things, and I was really proud of myself.</p><p>I was admired by people around me, because of how much work I do.</p><p>But I had this one flaw:</p><p>I could not say “NO” to anything. Just like you, I get new ideas everyweek to do something new. I would get pitched a new idea, a new joint venture on a regular basis.</p><p>As a result I was doing a dozen of things all at once.
It created an illusion that I was getting so much done, and I am super busy.</p><p>But if I examine the individual projects, I would see a bunch of half-baked things.
Things that are sucking my time.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="i-quit">I Quit!<a href="#i-quit" class="hash-link" aria-label="Direct link to I Quit!" title="Direct link to I Quit!">​</a></h2><p>The moment of realization came when I read the book The Dip from Seth Godin. All my life I was told you should never quit. But this book taught me, you should quit. You should quit early.</p><p>Finishing the book, I started to rearrange my work life. I knew I had to quit everything I am doing.</p><p>To be successful, you must quit every other thing and focus on just one thing only. When you are focused with that one thing, only then you will get the true success out of it.
The motivational advice comes handy then: don’t quit, keep going, just do it the thing you decided to work on.
Seth taught me to quit. Quit early, quit often. But once you have already into it deep, you are in the dip, don’t quit.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="saying-no">Saying No.<a href="#saying-no" class="hash-link" aria-label="Direct link to Saying No." title="Direct link to Saying No.">​</a></h2><p>No is my new best friend. I am saying “NO” to almost everything that comes to me. New ideas, new ventures, new partnerships, new offers, I turn down everything. First I must complete my current goal at hand, and once I am fully satisfied with the progress, only then I will accept something else.
This helped me to work on just a few things, as oppose to doing 10 different things at a time.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="a-gift-from-the-past">A Gift From The Past<a href="#a-gift-from-the-past" class="hash-link" aria-label="Direct link to A Gift From The Past" title="Direct link to A Gift From The Past">​</a></h2><p>Quitting is not easy. Especially when you have spent so much time and energy into something.</p><p>How can you quit something, that you put many years into?
Seth Godin recieved a similar question and his answer helped me very much. It goes something like this, better explained in this video from (Break the Twitch):</p><p>Imagine your past self gifted you something. Now you don’t have any space left in your closet to put that in. If you just get rid of the gift, you can make room for new stuff. You must treat that as a gift from your past self and remove it just as you would do with any old tangible good.</p><p><a href="https://www.youtube.com/watch?v=RPZLVEjCRh8" target="_blank" rel="noopener noreferrer">https://www.youtube.com/watch?v=RPZLVEjCRh8</a></p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="dont-quit-emotionally-make-a-plan">Don’t Quit Emotionally, Make a Plan<a href="#dont-quit-emotionally-make-a-plan" class="hash-link" aria-label="Direct link to Don’t Quit Emotionally, Make a Plan" title="Direct link to Don’t Quit Emotionally, Make a Plan">​</a></h2><p>Making emotional decisions can cost you a lot. Instead make a plan. Just give yourself some time and conditions.
Write down in paper: If I don’t get X amount of return within Y amount of time, I will quit this thing.
Give it some reasonable timeframe like 6-12 months and a reasonable outcome. What happens when you meet the goal? Make another timeframe. This will definitely help you keep the projects that work for you and get rid of the ones that are pulling you down.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="conclusion">Conclusion<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion">​</a></h2><p>The idea of quiting is horrible, embarrassing, and scary. It makes you look like a looser to other people. But if you quit properly, you will be left with only the things that matter to you most.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments:<a href="#comments" class="hash-link" aria-label="Direct link to Comments:" title="Direct link to Comments:">​</a></h2><p><strong>Shamim</strong>: I still remember the days when I was doing a job in BJMC and later created a company in Dhaka. My friends were running the company but I felt i need to quit. So, I quit from BJMC and got busy with SEO &amp; Internet Marketing stuff. 😉</p><blockquote><p>You quit your govt job. That was a big choice.</p></blockquote>]]></content:encoded>
            <category>opinion</category>
        </item>
        <item>
            <title><![CDATA[Roasting My First JavaScript App]]></title>
            <link>https://tamalweb.com/roasting-my-first-javascript-app</link>
            <guid>https://tamalweb.com/roasting-my-first-javascript-app</guid>
            <pubDate>Thu, 26 Apr 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[It’s time I look back at one of my very first JavaScript work and roast it.]]></description>
            <content:encoded><![CDATA[<p>It’s time I look back at one of my very first JavaScript work and roast it.</p><p>It was 2014, I had recently finished JavaScript and JQuery lessons from Codecademy. It was about time I build something with my knowledge.</p><p>At that time I didn’t know what actually JQuery was. I thought it’s another language like JS. Now I know well that, JQuery is a library which goes on top of JavaScript. It makes writing code a little bit easier.</p><p>An overview of what I am going to build:</p><p><img loading="lazy" alt="bkash calc" src="/assets/images/1-587d7686abf0fb59fb41aa359a9fc25b.png" width="638" height="423" class="img_ev3q"></p><p>There is a mobile payment service in Bangladesh called Bkash. You can use the service to pay friends. They charge a % for every time you want to cash out from your wallet.</p><p>The idea was simple,</p><ol><li>Have a text field so people can input an amount</li><li>Click on the button to calculate the result</li><li>The fee amount will show up</li></ol><p>I could not sleep the previous night. So I got up to my computer with enthusiasm. I built the logic first.</p><p>While trying to work on it, I learned the hard way: following a tutorial is easy but building something on my own doesn’t always behave the same way.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="the-javascript">The JavaScript<a href="#the-javascript" class="hash-link" aria-label="Direct link to The JavaScript" title="Direct link to The JavaScript">​</a></h2><p>Looking at my code, I rush coded a lot. I did not comment on the code, I didn’t even use semantic variable names.</p><div class="language-js codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-js codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> $b </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">$</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token string" style="color:rgb(206, 145, 120)">'input[name=bkashamount]'</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token punctuation" style="color:rgb(212, 212, 212)">.</span><span class="token method function property-access" style="color:rgb(220, 220, 170)">val</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain"></span><span class="token keyword" style="color:rgb(86, 156, 214)">var</span><span class="token plain"> $c </span><span class="token operator" style="color:rgb(212, 212, 212)">=</span><span class="token plain"> </span><span class="token function" style="color:rgb(220, 220, 170)">$cashout</span><span class="token punctuation" style="color:rgb(212, 212, 212)">(</span><span class="token punctuation" style="color:rgb(212, 212, 212)">)</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>Variable <code>$b</code> should have been called <code>balance</code>.</p><p><code>$c</code> should have been <code>change</code>.</p><p>I also didn’t add a class or ID for the input button text, which would’ve to make my life a bit more easier.</p><p>So you see all the code is a mess and harder to follow through.</p><p>The conditional logic tree was the hardest part.</p><p>It took me more than an hour to create a simple calculation to work. At the time of building the calculator, Bkash had a different fee structure.</p><p>Their fee % varies on the amount you are cashing out.</p><p><img loading="lazy" alt="Bkash old fee structure" src="/assets/images/2-f74551249844d222270381160f0e5e24.jpg" width="673" height="311" class="img_ev3q"></p><p>So I had to write a long set of conditions to fit the fee structure.</p><p>It was a really long (6-8) steps of else if codes.</p><p>It was a nightmare to make this work. So after I was done, I could display both a smaller amount and a larger amount with the correct fee.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="new-fee-structure">New Fee Structure<a href="#new-fee-structure" class="hash-link" aria-label="Direct link to New Fee Structure" title="Direct link to New Fee Structure">​</a></h2><p>Right after I implemented the cumbersome fee, I did a lookup online and found that Bkash now has a simplified fee structure.</p><p>What you know, they now have 1.85% flat fee for any amount you wanna cash out.</p><p><img loading="lazy" alt="Are you kidding me?" src="/assets/images/3-410522b9296496414d310ea0e31a9448.png" width="654" height="616" class="img_ev3q"></p><p>If I had known this earlier, it would have saved me a lot of trouble.</p><p>Anyways, I implemented the new fee structure.</p><p>After a few tweaks and checking my code part was ready.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="html-page">HTML Page<a href="#html-page" class="hash-link" aria-label="Direct link to HTML Page" title="Direct link to HTML Page">​</a></h2><p>The site has just a single HTML page for the view. It was the first time I coded a page without the help of the Bootstrap framework. At the time I did not know how to create a container in the middle so I used a table markup.</p><div class="language-html codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#9CDCFE;--prism-background-color:#1E1E1E"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-html codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#9CDCFE"><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">table</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">        </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">thead</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">        </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">thead</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">        </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">tbody</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">            </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">td</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">                </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">td</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">h1</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">a</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">href</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(212, 212, 212)">=</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">/</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">img</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">src</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(212, 212, 212)">=</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">images/logo.png</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">/&gt;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">a</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">h1</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">td</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">                </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">td</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;</span><span class="token tag" style="color:rgb(78, 201, 176)">iframe</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">src</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(212, 212, 212)">=</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">//www.facebook.com/plugins/like.php?href=https://tamalanwar.github.io/bkash-calc/%2F</span><span class="token tag attr-value entity named-entity" style="color:rgb(206, 145, 120)">&amp;amp;</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">width</span><span class="token tag attr-value entity named-entity" style="color:rgb(206, 145, 120)">&amp;amp;</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">layout=button_count</span><span class="token tag attr-value entity named-entity" style="color:rgb(206, 145, 120)">&amp;amp;</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">action=like</span><span class="token tag attr-value entity named-entity" style="color:rgb(206, 145, 120)">&amp;amp;</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">show_faces=false</span><span class="token tag attr-value entity named-entity" style="color:rgb(206, 145, 120)">&amp;amp;</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">share=true</span><span class="token tag attr-value entity named-entity" style="color:rgb(206, 145, 120)">&amp;amp;</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">height=21</span><span class="token tag attr-value entity named-entity" style="color:rgb(206, 145, 120)">&amp;amp;</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">appId=114661981960459</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">scrolling</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(212, 212, 212)">=</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">no</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">frameborder</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(212, 212, 212)">=</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">0</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag special-attr attr-name" style="color:rgb(156, 220, 254)">style</span><span class="token tag special-attr attr-value punctuation attr-equals" style="color:rgb(212, 212, 212)">=</span><span class="token tag special-attr attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag special-attr attr-value value css language-css property" style="color:rgb(206, 145, 120)">border</span><span class="token tag special-attr attr-value value css language-css punctuation" style="color:rgb(212, 212, 212)">:</span><span class="token tag special-attr attr-value value css language-css" style="color:rgb(206, 145, 120)">none</span><span class="token tag special-attr attr-value value css language-css punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token tag special-attr attr-value value css language-css" style="color:rgb(206, 145, 120)"> </span><span class="token tag special-attr attr-value value css language-css property" style="color:rgb(206, 145, 120)">overflow</span><span class="token tag special-attr attr-value value css language-css punctuation" style="color:rgb(212, 212, 212)">:</span><span class="token tag special-attr attr-value value css language-css" style="color:rgb(206, 145, 120)">hidden</span><span class="token tag special-attr attr-value value css language-css punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token tag special-attr attr-value value css language-css" style="color:rgb(206, 145, 120)"> </span><span class="token tag special-attr attr-value value css language-css property" style="color:rgb(206, 145, 120)">height</span><span class="token tag special-attr attr-value value css language-css punctuation" style="color:rgb(212, 212, 212)">:</span><span class="token tag special-attr attr-value value css language-css number" style="color:rgb(181, 206, 168)">21</span><span class="token tag special-attr attr-value value css language-css unit" style="color:rgb(206, 145, 120)">px</span><span class="token tag special-attr attr-value value css language-css punctuation" style="color:rgb(212, 212, 212)">;</span><span class="token tag special-attr attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag" style="color:rgb(78, 201, 176)"> </span><span class="token tag attr-name" style="color:rgb(156, 220, 254)">allowTransparency</span><span class="token tag attr-value punctuation attr-equals" style="color:rgb(212, 212, 212)">=</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag attr-value" style="color:rgb(206, 145, 120)">true</span><span class="token tag attr-value punctuation" style="color:rgb(212, 212, 212)">"</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">iframe</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">td</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">            </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">tr</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">        </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">tbody</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#9CDCFE"><span class="token plain">    </span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&lt;/</span><span class="token tag" style="color:rgb(78, 201, 176)">table</span><span class="token tag punctuation" style="color:rgb(212, 212, 212)">&gt;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><p>A table really?</p><p>Look, I also invented a new HTML tag called the <code>&lt;wrapper&gt;</code> wow!</p><p>Other than these rookie mistakes, the final design was good. It also had Facebook open graph tags which looked nice when I shared on social media.</p><p><img loading="lazy" alt="A simple Bkash fee calculator" src="/assets/images/4-6032c45ccac77db7e1800a3344918e7b.jpg" width="862" height="647" class="img_ev3q">
I also registered a free domain name BkashCalc.tk to host it.</p><p>I was happy and proud to share my work. Overall it was a good first project.</p><p>You can have a look at the working version here and the source code on Github.</p><p>Since then I made a new Bkash calculator with React:</p><p><img loading="lazy" alt="new calculator" src="/assets/images/5-6fa92fbbd099c5b4faf2a76c03772b95.gif" width="520" height="412" class="img_ev3q"></p><p>I don’t have the live version up but you can have a look at the source code.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments:<a href="#comments" class="hash-link" aria-label="Direct link to Comments:" title="Direct link to Comments:">​</a></h2><p><strong>Morol</strong>: I still remember the days when you first launched this app. 🙂</p><p>And this has been a pure roasting. 🙂</p><blockquote><p>Tamal: Thank you for following me from those days buddy! One thing I regret is, there has been a huge gap from those days to recent times. I wish I stick with just one path.
Ohh yeah, I am thinking about roasting my own stuff from now on, whenever I can feel creative. Feels good to tinker with old stuff 😀</p></blockquote>]]></content:encoded>
            <category>project</category>
            <category>javascript</category>
        </item>
        <item>
            <title><![CDATA[What Steve Jobs’ First iPhone Taught Me About Product Development]]></title>
            <link>https://tamalweb.com/what-steve-jobs-first-iphone-taught-me-about-product-development</link>
            <guid>https://tamalweb.com/what-steve-jobs-first-iphone-taught-me-about-product-development</guid>
            <pubDate>Thu, 19 Apr 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[Steve Jobs and his first iPhone changed everything. We were introduced to a new era. After the launch, every other phones were just a copy of the iphone. But I am not here to talk about the technological revolution of the smartphone industry.]]></description>
            <content:encoded><![CDATA[<p>Steve Jobs and his first iPhone changed everything. We were introduced to a new era. After the launch, every other phones were just a copy of the iphone. But I am not here to talk about the technological revolution of the smartphone industry.</p><p>I want to discuss the lessons I learned from Apple’s iPhone from a product development perspective.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="start-simple">Start Simple<a href="#start-simple" class="hash-link" aria-label="Direct link to Start Simple" title="Direct link to Start Simple">​</a></h2><p>If you look at the original iPhone, you would realize how lame that phone was. It didn’t had video recording option, no 3G, and many modern features you would expect from a new phone.</p><p><img loading="lazy" alt="apple vs nokia smartphone" src="/assets/images/1-278fc776a0f89cdd54783344e6704016.jpg" width="861" height="550" class="img_ev3q"></p><p>Apple could have put so many things into the iPhone and make it a killer feature rich smartphone, but they went for the simple route.</p><p>More feature means more research and development time. Steve Jobs and his team brought the minimum viable product to the market and see the reaction.</p><p>Although it lacked many essential features of a modern phone that time, it did just a few things right.</p><p>For the iPhone, its wow factor was the full screen touch screen, rotating screen, iPod, internet and messaging features.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="sell-on-the-benefits">Sell on The Benefits<a href="#sell-on-the-benefits" class="hash-link" aria-label="Direct link to Sell on The Benefits" title="Direct link to Sell on The Benefits">​</a></h2><p>Steve Jobs talked about the user interface and how it is built for day to day situations. He got rid of the stylus in favor of finger touch. He scrolled down the contact list, the music library to show how easy it is to scroll through the long list of items with a touchscreen.</p><p>Messages were modern and looks like modern messaging apps. You need to swipe to unlock the screen so that it does not accidentally unlocks in your pocket.</p><p>He didn’t sold on how much ram or processing power the phone has, all he did was show what the iPhone can do.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="add-another-feature-in-your-next-version">Add Another Feature in Your Next Version<a href="#add-another-feature-in-your-next-version" class="hash-link" aria-label="Direct link to Add Another Feature in Your Next Version" title="Direct link to Add Another Feature in Your Next Version">​</a></h2><p>The next iPhone had some extra features like video recording, 3G and faster speed. They could have included it on the first iphone but they didn’t. They made it into a second version just so they can sell more units.</p><p>I don’t like that companies making products that don’t last longer. To increase the profits they launch a new product every year with slightly more features than before and drop support for the older ones.</p><p>Since the first iPhone, Apple kept launching one/two new iPhones every year with slightly better features. So please take note, if you want to increase your profit margins, launch new versions of the same product to sell more and more copies.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="applying-steve-jobs-formula-on-my-own">Applying Steve Jobs’ Formula on My Own:<a href="#applying-steve-jobs-formula-on-my-own" class="hash-link" aria-label="Direct link to Applying Steve Jobs’ Formula on My Own:" title="Direct link to Applying Steve Jobs’ Formula on My Own:">​</a></h2><p>Few years ago I learnt about WordPress theme development and I was so hooked up to create my own themes. For my first theme to the public, I thought of going the easy way by creating a free theme. This way, the expectations would be low.</p><p>Then I applied Steve Jobs’ iPhone formulla, by stripping out all the modern features of that theme and just go with a simple presentable theme.</p><p>I was still learning at the moment and implementing many features would increase the development time.</p><p>So I created version 1.0 of that theme with some basic features.</p><p><img loading="lazy" alt="blogkori theme" src="/assets/images/2-d046b4b6e58c1387189d2279f661613c.jpg" width="500" height="375" class="img_ev3q"></p><p>The theme was so simple with nothing more than just regular WordPress features, like custom header, background image, background color etc. These are default features which come with WordPress.</p><p><strong>My finished version was pretty plain.</strong></p><p>The first theme had this default blue color scheme which you can’t even change from the options.</p><p>I ignored what my theme doesn’t have and used what I have:</p><p>I talked about the benefits of using the theme like</p><ul><li>Having a good typography keeps the reader engaged</li><li>Simple site loads faster</li><li>The code has HTML5 semantic markup for better search rankings etc.</li></ul><p>So anyways I put the theme out to the public. A few people tried it out and started to use it.</p><p>I added a few more code improvements and submit the theme to WordPress theme directory. After it was approved, I saw lots of downloads.</p><p>People loved my free theme. More than 1,000 people are using the theme. Every now and then I get message from people who are using and loving the theme.</p><p>It motivated me and got me to work on the theme again.</p><p>On the next version I added Google Analytics options, then followed by color scheme option.</p><p>You see, I did not wasted my time trying to make my product filled with lots of cool features. I stick to the essentials, get it out to the public and talked about the benefits.</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="conclusion">Conclusion:<a href="#conclusion" class="hash-link" aria-label="Direct link to Conclusion:" title="Direct link to Conclusion:">​</a></h2><p>We can learn a lot by following Steve Jobs and Apple products. Just watching one video how Steve launches a new product can teach you a lot about selling technology to the masses.</p><p><a href="https://www.youtube.com/watch?v=wGoM_wVrwng" target="_blank" rel="noopener noreferrer">https://www.youtube.com/watch?v=wGoM_wVrwng</a></p><p>To sum it all up:</p><ol><li>Create a minimum viable product (MVP) and get it out to the public for feedback</li><li>Add more features as you go on with next iterations</li><li>Talk about the benefits, not the features</li></ol><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments:<a href="#comments" class="hash-link" aria-label="Direct link to Comments:" title="Direct link to Comments:">​</a></h2><p><strong>Ryan Biddulph:</strong> Good analogy Tamal! Simple wins. Every time. Simple, clear, basic, all are winning elements in the product development game. This is why all of my eBooks, courses and audio books are simple. The ultimate lesson in life is to keep things basic, to remove the complex, and folks doing this become icons. You are on your way brother.</p><p>Ryan</p><blockquote><p>Tamal: Good to see you here buddy! Yes, simple rocks!</p></blockquote>]]></content:encoded>
            <category>project</category>
        </item>
        <item>
            <title><![CDATA[I Never Thought I Would Become A Programmer One Day]]></title>
            <link>https://tamalweb.com/i-never-thought-i-would-become-a-programmer-one-day</link>
            <guid>https://tamalweb.com/i-never-thought-i-would-become-a-programmer-one-day</guid>
            <pubDate>Thu, 12 Apr 2018 00:00:00 GMT</pubDate>
            <description><![CDATA[Growing up I was just a regular boy. I was never good at science or maths. I like to break things apart, but I wont call myself a tech nerd. So how did a regular guy like me turn into a programmer, coding things from scratch?]]></description>
            <content:encoded><![CDATA[<p>Growing up I was just a regular boy. I was never good at science or maths. I like to break things apart, but I wont call myself a tech nerd. So how did a regular guy like me turn into a programmer, coding things from scratch?</p><p>Let’s be honest here, programming is not that easy. It takes discipline and repeated effort to code something on your own, build a thing which actually works. I never thought someday I would turn into a web developer and actually code in this weird language.</p><p>Please note: I am using the words “coding”, “development”, and “programming” interchangeably in this article, although they all have very different meanings. But you get the point!</p><p>When I get the chance to talk to people who are new to code, it reminds me how it felt when I was just starting out.</p><p>Some time ago, I met this guy at a conference. It was not a developer conference, it was more like a marketing one. While talking with him, he learned about my web development work and how I became a self taught web developer.</p><p>Knowing that, he expressed to me that he can never ever learn to code:</p><p>“You know Tamal bro, I can never learn how to code. I just don’t get it!”</p><p>So instead of comforting him by saying how everyone can code, how easy it is and all that, I told him:</p><p>“You are right, you won’t get it. I was just like you many years ago when I just couldn’t understand all the code.”</p><p>“HTML code looked like Chinese text to me.”</p><p>“All I did was just copy and paste bunch of codes and put it all together.”</p><p>“But as I built many websites, I slowly started to get it.”</p><p>Hearing my words gave him comfort, and I think after that day he will see programming in a different light.</p><p>When I got started into building websites, I came across all the free resources like blogs, tutorials and W3Schools. But I didn’t even had the skill to read and learn from the documentation.</p><p>For me it took a while to condition myself into a programming mindset to finally understand how to code things.</p><p>It didn’t happen magically just by watching a few tutorial videos or completing a course. The real journey was different. To help you track how I got so far, here is a quick highlight of my learning over the years:</p><ul><li><strong>Early days</strong>: I used website builders and MS FrontPage to build websites. Used Flash to create interfaces.</li><li><strong>Blogger/blogspot days</strong>: Copy pasted code from various places to design sites.</li><li><strong>WordPress days</strong>: Used little HTML &amp; PHP code to change various design elements. Once again, I copy pasted from the web.</li><li><strong>Thesis theme days</strong>: I used the Thesis Theme to build designs. Learned little CSS to customize the websites but most of it was copy-pasta.</li><li><strong>Codecademy</strong>: Took my first formal programming lesson with the Hour of Code. Took formal lessons on HTML, CSS, JavaScript, JQuery and PHP from Codecademy. Built my first “Thing” with JS.</li><li><strong>WordPress themes</strong>: Built my first WordPress theme and got it approved to the theme directory. This is when I started to call myself a real web developer.</li><li><strong>Modern times</strong>: I made my mind to pursue a career in web development/programming. I am learning how to build web applications with Node.js and JavaScript.</li><li><strong>In 2019</strong>: I am studying to become a software engineer.</li></ul><p>As you can see, I spent a long time just copy and pasting bunch of code from the internet.</p><p>Taking formal courses gave me a bird eye view over the subject but it did not instantly turned me into a pro. It took repeated effort and practice to master various things.</p><p>Now I see my learning curve is getting shorter. I am learning new technology faster as I practice more.</p><p>So if there is anything you can take from my story: everyone learns differently. If you want to do this kind of thing, give it a shot. If you really love to program, you will learn it eventually (no matter how long it takes).</p><h2 class="anchor anchorWithStickyNavbar_LWe7" id="comments">Comments<a href="#comments" class="hash-link" aria-label="Direct link to Comments" title="Direct link to Comments">​</a></h2><p><strong>DJ Rony:</strong> There is no shortcut or easy way, only the hard way. All the best brother.</p><blockquote><p>Tamal: Good to see you here DJ! Yes that’s true, there’s no shortcut.</p></blockquote><p><strong>Oksana:</strong> Well done !! It’s a proof that only hard persistent work, grinding and patience can lead to success! Go for it!</p><blockquote><p>Tamal: Thanks for dropping by Oksana, all the best to your code learning!</p></blockquote>]]></content:encoded>
            <category>opinion</category>
        </item>
    </channel>
</rss>