<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prathamesh More on Medium]]></title>
        <description><![CDATA[Stories by Prathamesh More on Medium]]></description>
        <link>https://medium.com/@pprathameshmore?source=rss-8211f67416b1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Nw2mjbG1Cq582QXpRAuezQ.jpeg</url>
            <title>Stories by Prathamesh More on Medium</title>
            <link>https://medium.com/@pprathameshmore?source=rss-8211f67416b1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 08:30:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pprathameshmore/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Best Marathi Matrimony Platform: Find Your Perfect Match with MarathiVivah]]></title>
            <link>https://pprathameshmore.medium.com/best-marathi-matrimony-platform-find-your-perfect-match-with-marathivivah-9d969742d325?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d969742d325</guid>
            <category><![CDATA[vivah]]></category>
            <category><![CDATA[maratha-empire]]></category>
            <category><![CDATA[relationships]]></category>
            <category><![CDATA[kolhapur]]></category>
            <category><![CDATA[matrimony]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 06:18:59 GMT</pubDate>
            <atom:updated>2026-03-17T06:30:39.996Z</atom:updated>
            <content:encoded><![CDATA[<p>Finding the right life partner is one of the most important decisions in life. For the Marathi community, where traditions, values, and compatibility play a crucial role, choosing the right matrimony platform becomes even more important.</p><p>In today’s digital age, platforms like Marathi Vivah are transforming how families in Maharashtra connect and find suitable brides and grooms.</p><p>Start your journey here: <a href="https://www.marathivivah.co.in/">https://www.marathivivah.co.in</a></p><h4>Why Marathi Matrimony Needs a Dedicated Platform</h4><p>Most matrimony websites are designed for a broad audience, which often leads to irrelevant matches and wasted time.</p><p>A dedicated Marathi matrimony platform ensures:</p><ul><li>Profiles from Marathi families only</li><li>Better cultural compatibility</li><li>More relevant matches</li><li>Faster decision-making</li></ul><p>This makes the process more efficient and meaningful.</p><h4>Find Matches in Pune, Kolhapur, Sangli &amp; Satara</h4><p>Many families prefer matches within nearby regions for convenience and cultural familiarity.</p><p>With Marathi Vivah, you can easily find:</p><ul><li>Marathi grooms in Pune</li><li>Marathi brides in Kolhapur</li><li>Verified profiles from Sangli and Satara</li></ul><p>Read more about digital matchmaking trends:</p><p><a href="https://www.marathivivah.co.in/blogs/read/marathi-vivah-in-digital-age">Marathi Vivah in the Digital Age</a></p><h4>AI-Powered Profile Summarisation</h4><p>Browsing hundreds of profiles can be overwhelming</p><p>Marathi Vivah simplifies this with AI profile summarisation, which:</p><ul><li>Highlights key details instantly</li><li>Saves time</li><li>Helps you shortlist faster</li></ul><h4>Kundli Matching for Better Compatibility</h4><p>In Marathi culture, horoscope matching is still an important step.</p><p>With built-in Kundli matching, you can:</p><ul><li>Check compatibility easily</li><li>Make informed decisions</li><li>Combine tradition with modern technology</li></ul><h4>Secure OTP Login for Trusted Profiles</h4><p>Security is a major concern in online matchmaking.</p><p>MarathiVivah ensures safety with:</p><ul><li>OTP-based login</li><li>Verified users only</li><li>Reduced fake profiles</li></ul><h4>Know Who Viewed Your Profile</h4><p>The “Who Viewed Your Profile” feature helps you:</p><ul><li>Identify interested matches</li><li>Track engagement</li><li>Connect with the right people</li></ul><h4>Privacy with Blurred Photos</h4><p>Privacy is essential, especially in matrimony platforms.</p><p>MarathiVivah protects users with:</p><ul><li>Blurred photos on public pages</li><li>Secure data handling</li></ul><h4>Android App for Easy Access</h4><p>Stay connected anytime, anywhere with the MarathiVivah Android app.</p><ul><li>Easy browsing</li><li>Seamless experience</li></ul><p>Perfect for busy professionals.</p><h4>Smart Filters for Better Matches</h4><p>Find your ideal partner based on:</p><ul><li>Profession (Engineers, IT Professionals, MBA, etc.)</li><li>Education</li><li>Location</li><li>Community (Maratha, Brahmin, etc.)</li><li>Lifestyle preferences</li></ul><p>This ensures you only see relevant profiles.</p><h4>Safe, Verified &amp; Genuine Profiles</h4><p>MarathiVivah focuses on trust and authenticity:</p><ul><li>Verified profiles</li><li>Secure communication</li><li>Privacy-first approach</li></ul><h4>Why Marathi Vivah is the Best Choice?</h4><p>Compared to generic platforms, MarathiVivah offers:</p><ul><li>Community-focused matchmaking</li><li>AI-powered insights</li><li>Kundli matching</li><li>Strong privacy controls</li><li>Mobile-first experience</li></ul><h4>Final Thoughts</h4><p>The future of Marathi matrimony is digital, secure, and intelligent.</p><p>Whether you are looking for a Marathi bride in Pune or a Marathi groom in Kolhapur, Marathi Vivah makes the process simple and effective.</p><p>Join today and find your perfect life partner:</p><p><a href="http://www.marathivivah.co.in/">https://www.marathivivah.co.in</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d969742d325" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Choose the Right Life Partner in Marathi Community?]]></title>
            <link>https://pprathameshmore.medium.com/how-to-choose-the-right-life-partner-in-marathi-community-0bd89abb9ed4?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bd89abb9ed4</guid>
            <category><![CDATA[matrimony]]></category>
            <category><![CDATA[maharashtra]]></category>
            <category><![CDATA[marriage]]></category>
            <category><![CDATA[arranged-marriage]]></category>
            <category><![CDATA[relationships]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Wed, 11 Feb 2026 09:05:23 GMT</pubDate>
            <atom:updated>2026-02-11T09:05:23.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VxOWsYX1sZ-qJPx3" /><figcaption>Photo by <a href="https://unsplash.com/@ydvmikesh?utm_source=medium&amp;utm_medium=referral">Krishna Yadav</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Choosing the right life partner is one of the most important decisions in life. In the Marathi community, marriage is not just a union of two individuals — it is a bond between two families, traditions, and lifelong values.</p><p>Whether through arranged marriage or modern matchmaking platforms, selecting a compatible partner requires thoughtful evaluation beyond surface qualities.</p><p>Here is a practical and culturally balanced guide to help you make the right decision.</p><h4><strong>Understand Family Values and Background</strong></h4><p>In Marathi culture, family plays a central role in marriage decisions.Before finalizing a match, consider:</p><ul><li>Family values and reputation</li><li>Cultural traditions and rituals</li><li>Expectations after marriage</li><li>Openness toward modern lifestyle</li></ul><p>When families share similar values, long-term harmony becomes easier.</p><h4>Compatibility Beyond Horoscope Matching</h4><p>Kundali matching is important in many Marathi households. However, compatibility goes beyond astrology.</p><p>Discuss openly:</p><ul><li>Career goals</li><li>Financial expectations</li><li>Relocation plans</li><li>Lifestyle preferences</li><li>Future family planning</li></ul><p>Emotional maturity and shared life vision matter more in everyday married life.</p><h4>Education and Career Alignment</h4><p>Modern Marathi marriages often balance tradition with ambition.</p><p>Ask:</p><ul><li>Are both partners career-oriented?</li><li>Are families supportive of working women?</li><li>Are job transfers expected?</li><li>What are long-term financial goals?</li></ul><p>Clarity in professional expectations prevents misunderstandings later.</p><h4>Communication and Mutual Respect</h4><p>Strong marriages are built on respect and communication.</p><p>Look for:</p><ul><li>Honest conversations</li><li>Ability to resolve disagreements calmly</li><li>Emotional understanding</li><li>Respect toward elders and family traditions</li></ul><p>Marriage is a lifelong partnership — not just a wedding ceremony.</p><h4>Cultural and Religious Compatibility</h4><p>From Ganpati celebrations to traditional rituals like Sakharpuda and Haldi, cultural alignment strengthens bonding.</p><p>Discuss:</p><ul><li>Religious practices</li><li>Festival celebrations</li><li>Community involvement</li><li>Family responsibilities after marriage</li></ul><p>Shared traditions create emotional stability.</p><h4>Prioritize Safety and Profile Verification</h4><p>With online Marathi matrimony becoming popular, safety is extremely important.</p><p>Always:</p><ul><li>Verify profile information</li><li>Confirm education and profession</li><li>Involve families in early discussions</li><li>Take time before final decisions</li></ul><p>Trust should be built step by step.</p><h3>Frequently Asked Questions</h3><h4>Q1: What is most important when choosing a life partner in the Marathi community?</h4><p>Value alignment, mutual respect, and long-term compatibility are most important.</p><h4>Q2: Is horoscope matching mandatory?</h4><p>Many families consider it important, but emotional compatibility and communication are equally essential.</p><h4>Q3: Is online Marathi matrimony safe?</h4><p>Yes, if you use a trusted platform with verified profiles and family involvement.</p><h3>Final Thoughts</h3><p>Choosing the right life partner in the Marathi community means balancing:</p><p>✔ Tradition<br> ✔ Family values<br> ✔ Modern compatibility<br> ✔ Emotional maturity<br> ✔ Long-term vision</p><p>Marriage is not about finding a perfect person — it is about finding someone with whom you can build a meaningful and respectful life.</p><p>If you are looking for verified Marathi bride and groom profiles across Maharashtra, you can explore:</p><p>👉 <a href="https://marathivivah.co.in/"><strong>https://marathivivah.co.in</strong></a></p><p>Start your journey with clarity, confidence, and cultural understanding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bd89abb9ed4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Express.js App Is Not Safe Until You Do This: Error Handling Best Practices]]></title>
            <link>https://medium.com/analytics-vidhya/error-handing-in-express-js-node-js-based-application-0da14e13fa63?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0da14e13fa63</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Wed, 05 Jun 2024 04:31:49 GMT</pubDate>
            <atom:updated>2025-12-12T07:42:51.887Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we will create an error-handling library for Express.js-based applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rsGx_Vl6rU5De2mS" /><figcaption>Photo by <a href="https://unsplash.com/@thaliatran?utm_source=medium&amp;utm_medium=referral">Thalia Tran</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Sometimes, errors in application responses can be inconsistent. To address this, we can use proper middleware and error types to ensure consistency. By using Express Validator, we can validate parameters, queries, and request bodies effectively.</p><p>This approach makes it easier for the frontend to display accurate and consistent error messages.</p><h4>Let’s start</h4><p>We will be using TypeScript for this project.</p><p>npm install -g typescript</p><p>Run npm init -y &amp;&amp; npx tsc --initto create a TypeScript-based Node.js project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*c9T9fg48CPjKlammG8OtUg.png" /><figcaption>Project Structure</figcaption></figure><p>First, we start by creating a Custom Error class, which will serve as a blueprint for other child error classes. By extending this base class, we can create various types of errors tailored to our needs.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa0424888845d72335ccea18c7e65a9d/href">https://medium.com/media/fa0424888845d72335ccea18c7e65a9d/href</a></iframe><p>Now, using this abstract base class, create a Bad Request Error class</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c00701bcedaab5b42fad42167528d87d/href">https://medium.com/media/c00701bcedaab5b42fad42167528d87d/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/291c0a21719d7bf1c069f66a1865bcaf/href">https://medium.com/media/291c0a21719d7bf1c069f66a1865bcaf/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b70569c1d33cbcf2b2af761081a2682f/href">https://medium.com/media/b70569c1d33cbcf2b2af761081a2682f/href</a></iframe><p>These types of different errors we can create.</p><p>Now, let’s create a Request Validation Error handler.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e3c67b853c5924c881ad99722cafcaf/href">https://medium.com/media/2e3c67b853c5924c881ad99722cafcaf/href</a></iframe><p>I have created the following errors</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*jrdxtc8Qif9pac-doE14mQ.png" /></figure><p>We will create error handler middleware to be used at the root level of the Express application, along with request validator middleware to validate request queries, parameters, and bodies.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a69a35121a002e2c120b75ef9ed25f94/href">https://medium.com/media/a69a35121a002e2c120b75ef9ed25f94/href</a></iframe><p>If a thrown error is an instance of a Custom Error, we will send a status code and an error array obtained from the Custom Error class instance.</p><p>Now, create a request validator,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cbcd4d6c06917433859ea953a723f027/href">https://medium.com/media/cbcd4d6c06917433859ea953a723f027/href</a></iframe><p>In the above code snippet, we are using functionvalidationRequest from express-validator package.</p><p>This will help us validate the request query, params, and body.</p><p>Now let’s export these middleware functions</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5daaf79c182b82013793b8da1b51e67/href">https://medium.com/media/f5daaf79c182b82013793b8da1b51e67/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8bcc367032adc9b7333a759de4770da/href">https://medium.com/media/b8bcc367032adc9b7333a759de4770da/href</a></iframe><p><em>package.json and tsconfig.json </em>file configuration looks like this,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/63d5e8a4505913760e690585b0d31d58/href">https://medium.com/media/63d5e8a4505913760e690585b0d31d58/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5eb8285ae3d101d8aa5da1164d997dff/href">https://medium.com/media/5eb8285ae3d101d8aa5da1164d997dff/href</a></iframe><p>Now, Learn how to use this library in our code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b0b01de6758ba4bfbf59ca5eb2be8b0/href">https://medium.com/media/0b0b01de6758ba4bfbf59ca5eb2be8b0/href</a></iframe><p>I have already created a library for this purpose.</p><p><a href="https://www.npmjs.com/package/common-utils-functionalities">https://www.npmjs.com/package/common-utils-functionalities</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0da14e13fa63" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/error-handing-in-express-js-node-js-based-application-0da14e13fa63">Your Express.js App Is Not Safe Until You Do This: Error Handling Best Practices</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Authentication from Scratch with Firebase, Redux, Formik, React Router V6, and Material UI]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/analytics-vidhya/react-authentication-from-scratch-with-firebase-redux-formik-react-router-v6-and-material-ui-dc719739a9d6?source=rss-8211f67416b1------2"><img src="https://cdn-images-1.medium.com/max/2600/0*P1hrJmyjHQLB1Ncv" width="5643"></a></p><p class="medium-feed-snippet">In this blog, we will implement React Authentication with Firebase, Redux, and Material UI.</p><p class="medium-feed-link"><a href="https://medium.com/analytics-vidhya/react-authentication-from-scratch-with-firebase-redux-formik-react-router-v6-and-material-ui-dc719739a9d6?source=rss-8211f67416b1------2">Continue reading on Analytics Vidhya »</a></p></div>]]></description>
            <link>https://medium.com/analytics-vidhya/react-authentication-from-scratch-with-firebase-redux-formik-react-router-v6-and-material-ui-dc719739a9d6?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc719739a9d6</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[formik]]></category>
            <category><![CDATA[react-router-6]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Tue, 24 May 2022 11:18:37 GMT</pubDate>
            <atom:updated>2022-05-24T11:18:37.531Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Create a YouTube Downloader with Node.js and React]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://javascript.plainenglish.io/how-to-create-a-youtube-downloader-with-node-js-and-react-a86d7586fcc8?source=rss-8211f67416b1------2"><img src="https://cdn-images-1.medium.com/max/2600/0*7Vq1uUDc9MSdtvvc" width="5983"></a></p><p class="medium-feed-snippet">In this tutorial, we will be building a YouTube Downloader with the backend implemented in Express and the frontend in React.</p><p class="medium-feed-link"><a href="https://javascript.plainenglish.io/how-to-create-a-youtube-downloader-with-node-js-and-react-a86d7586fcc8?source=rss-8211f67416b1------2">Continue reading on JavaScript in Plain English »</a></p></div>]]></description>
            <link>https://javascript.plainenglish.io/how-to-create-a-youtube-downloader-with-node-js-and-react-a86d7586fcc8?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a86d7586fcc8</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Mon, 05 Jul 2021 14:08:44 GMT</pubDate>
            <atom:updated>2025-12-12T08:36:00.331Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Connect to Redis from wherever you send HTTP Requests]]></title>
            <link>https://javascript.plainenglish.io/connect-to-redis-from-wherever-you-send-http-requests-569eaf190d66?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/569eaf190d66</guid>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Fri, 16 Apr 2021 15:56:44 GMT</pubDate>
            <atom:updated>2021-04-20T03:19:11.441Z</atom:updated>
            <content:encoded><![CDATA[<h3>Connect to Serverless Redis via GraphQL from wherever you send HTTP Requests</h3><p>In this article, we will take a look at accessing the Redis database directly from your client app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z2rRUpddLLqz7E8V" /><figcaption>Photo by <a href="https://unsplash.com/@firosnv?utm_source=medium&amp;utm_medium=referral">Firos nv</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this article, we will implement an event booking application, which will include the following features:</p><ol><li>Creating an event in the database.</li><li>Pushing events to the cache.</li><li>Cache trending events, so we will run the CRON job for updating trending events in cache periodically.</li><li>On the client-side React app, we will be fetching trending events directly from the Redis server using GraphQL, ie, no need to connect with the actual server.</li></ol><pre>REST API Routes<br>1. POST =&gt; /api/events =&gt; Create events<br>2. GET  =&gt; /api/events =&gt; Get all events</pre><h4>Software requirements</h4><ol><li><a href="https://nodejs.org/en/">Nod</a>e.js — Node.js® is a JavaScript runtime built on <a href="https://v8.dev/">Chrome’s V8 JavaScript engine</a>.</li><li><a href="https://expressjs.com/">Express </a>— Fast, unopinionated, minimalist web framework for <a href="https://nodejs.org/en/">Node.js</a></li><li><a href="https://www.postman.com/">Postman </a>— A collaboration platform for API development.</li></ol><p>Let’s begin.</p><p>Install the required packages on your local machine:</p><pre>npm install express mongoose dotenv redis — save</pre><p><strong>Set up Redis database with Upstash</strong></p><p><strong>Upstash </strong>is a serverless database for Redis. With servers/instances, you usually pay per hour or at a fixed price. With serverless, you pay-per-request.</p><p>This means you’re not charged when the database isn’t in use. Upstash configures and manages the database for you.</p><p>Start by creating an account on <a href="https://upstash.com/"><strong>Upstash</strong></a><strong>.</strong></p><p>Now set up the Redis database instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H-Ve88Ysi1yRp1FQsv1qZA.png" /><figcaption>Create New Database</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qXi6NIKaAutMgF0p2nkXqw.png" /><figcaption>Connect to your database</figcaption></figure><p>Don’t forget to add the .env file in the root directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/0*vK6kLJ4K8jbFFMpZ.png" /><figcaption>Root Directory Structure</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*rIOSf-Myalw6REZiTLMmeQ.png" /><figcaption>.env file</figcaption></figure><p>Create a simple server and connect to the local or remote MongoDB database:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9004f522f13b5a3e8a03c51892d55a4/href">https://medium.com/media/a9004f522f13b5a3e8a03c51892d55a4/href</a></iframe><p>Now connect to the Redis server using the configuration provided by Upstash:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/becc7823b086c917138bbcc064bd0f58/href">https://medium.com/media/becc7823b086c917138bbcc064bd0f58/href</a></iframe><p>Mongoose model:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2df5b7854f54a861a205343d052c51b6/href">https://medium.com/media/2df5b7854f54a861a205343d052c51b6/href</a></iframe><p>Now implement the logic for caching trending events periodically. Basically here, we are using a setInterval() mock-up CRON job.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46f7f0681abca242c3f64eb39bed23b0/href">https://medium.com/media/46f7f0681abca242c3f64eb39bed23b0/href</a></iframe><p>Now implement API routes:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31e1f407c271d7d8a0aab4a6c5202e3e/href">https://medium.com/media/31e1f407c271d7d8a0aab4a6c5202e3e/href</a></iframe><p>For creating the event, we require thetitle, description, imageURL, timeAndDate, fees, notes from user.</p><p>Also, we are pushing these events in the Redis cache.</p><h4>Final code for server app:</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6366f5aff1ef6992210fc72ee275227/href">https://medium.com/media/c6366f5aff1ef6992210fc72ee275227/href</a></iframe><h4>Now, Let’s implement a client app using React</h4><p>Create boilerplate code for React by running the following command:</p><p>npx create-react-app client-app &amp;&amp; cd client-app</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*Og2l2b5LEdurFjGnbYEHVA.png" /><figcaption>Folder Structure for React.js app</figcaption></figure><p>Install the Apollo client library:</p><p>npm i @apollo/client</p><p>Now, connect to the Redis database. In your <strong>index.js </strong>file<strong>, </strong>add following code to set up the GraphQL client and connect to Upstash’s GraphQL server:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/36a50810f6cd12838a4bf0dd3883e7a7/href">https://medium.com/media/36a50810f6cd12838a4bf0dd3883e7a7/href</a></iframe><p>Get credentials from Upstash:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njwzMGB75Q-iEQMsA65Ugg.png" /><figcaption>Upstash GraphQL Redis</figcaption></figure><blockquote><strong>Note</strong>: Use READ ONLY access key on client-side.</blockquote><p>Now add Bootstrap for UI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KqD04rSOhU_M3ZCLezAhjA.png" /><figcaption>Bootstrap</figcaption></figure><p>Implement code for fetching trending events directly from Upstash Redis:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/119b8c1a391e28e9d6ea7f7478356e6a/href">https://medium.com/media/119b8c1a391e28e9d6ea7f7478356e6a/href</a></iframe><p>Then try to run using npm start :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtjNciolJuOHjXNLbdEoDA.png" /><figcaption>Running React.js app</figcaption></figure><p>You will see trending events, directly fetched from the Redis database.</p><p><strong><em>Check out </em></strong><a href="https://upstash.com/"><strong><em>Upstash </em></strong></a><strong><em>for production.</em></strong></p><p><em>More content at </em><a href="http://plainenglish.io/"><em>plainenglish.io</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=569eaf190d66" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/connect-to-redis-from-wherever-you-send-http-requests-569eaf190d66">Connect to Redis from wherever you send HTTP Requests</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Redis and Caching with Node.js using Upstash]]></title>
            <link>https://javascript.plainenglish.io/introduction-to-redis-and-caching-with-node-js-using-upstash-88efbe39eea2?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/88efbe39eea2</guid>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Sat, 20 Mar 2021 08:16:22 GMT</pubDate>
            <atom:updated>2021-04-20T03:24:42.655Z</atom:updated>
            <content:encoded><![CDATA[<h3>Serverless Redis Caching with Node.js</h3><h4>Redis is an in-memory data structure used for cache. In this blog, we will implement a simple Node.js app that uses Serverless Redis, and also we will be using Upstash — Serverless<br>Database for Redis.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MLfP-fQt4mUhKZvX" /><figcaption>Photo by <a href="https://unsplash.com/@clemhlrdt?utm_source=medium&amp;utm_medium=referral">Clément Hélardot</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>What is Redis?</h4><p>Redis is an open-source, in-memory data structure store, used as a NoSQL database for the cache to improve the overall response rate for most frequently requested data.</p><p>In this blog, we will develop Notes Taking App API, We will implement two feature,</p><ol><li>Take a note from the user.</li><li>Return a note back to the user.</li></ol><p>But here will use Redis, to cache note. If the user requests the same note frequently, we will return notes stored in Redis.</p><pre>REST API Routes</pre><pre>1. POST =&gt; /api/notes =&gt; Create notes<br>2. GET  =&gt; /api/notes/:id =&gt; Get a note</pre><p><strong>Software Requirements</strong></p><p>Let’s begin,</p><p>Install the required packages on your local machine:</p><pre>npm install express body-parser mongoose redis --save</pre><p><strong>Set up Redis database with Upstash,</strong></p><p><strong>Upstash </strong>is a serverless database for Redis, with servers/instances, you pay-per-hour or a fixed price. With Serverless, you pay per request.</p><p>This means you’re not charged when the database isn’t in use. Upstash configures and manages the database for you.</p><p>Let’s start with creating an account on <strong>Upstash</strong>,</p><p><a href="https://upstash.com/">https://upstash.co</a>m/</p><p>Now set up database instance,</p><figure><img alt="Create New Database" src="https://cdn-images-1.medium.com/max/1024/1*WQ4am-ITQFY7X1jFUAUYcg.png" /><figcaption>Create New Database</figcaption></figure><figure><img alt="Connect to your database" src="https://cdn-images-1.medium.com/max/1024/1*NS2-cVYWz2z_qZR0m8ra5Q.png" /><figcaption>Connect to your database</figcaption></figure><p>Create a simple server and connect to the MongoDB database:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fdc74cecd8e9ec92bb4753ca35fd12ea/href">https://medium.com/media/fdc74cecd8e9ec92bb4753ca35fd12ea/href</a></iframe><p>Now connect to the Redis server using the configuration provided by Upstash:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/becc7823b086c917138bbcc064bd0f58/href">https://medium.com/media/becc7823b086c917138bbcc064bd0f58/href</a></iframe><p>Mongoose Model:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/43dec3a2301ddedce441c14c2fc17ced/href">https://medium.com/media/43dec3a2301ddedce441c14c2fc17ced/href</a></iframe><p>Now implement routes for API</p><p>Get a note from the user and store it Redis and MongoDB:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/875685ee0da0250e5e2d63e5ada3da63/href">https://medium.com/media/875685ee0da0250e5e2d63e5ada3da63/href</a></iframe><p>Take look here in the code, we used a method setex to store data in Redis.</p><p>This method takes 4 parameters</p><ol><li>id : Unique ID must be provided to store data. It must be a string.</li><li>seconds : Expiry time in seconds as a number.</li><li>value : Actual data to store in Redis. It must be a string. So we are serializing object into string .</li><li>callback : Callback takes two parameters err and reply .</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o07mPlNL0ML-0ZWawZ8L8g.png" /><figcaption>Create a note</figcaption></figure><p>Now retrieve data, first, we have to check in Redis for data, if data is not available in Redis then we have to make a query in the database.</p><p>For that, we have to write middleware that checks the requested data in Redis.</p><p>Middleware:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e71661459c7be8fcad132cb21047694/href">https://medium.com/media/0e71661459c7be8fcad132cb21047694/href</a></iframe><p>In the above middleware, we used get() method to retrieve existing data from Redis. get(id, callback()) .</p><p>Here we parsed string back to the object .</p><p>Now use this middleware onget request:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f2afade23b9fbe0638f8dcff8f3a4c12/href">https://medium.com/media/f2afade23b9fbe0638f8dcff8f3a4c12/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2gGYqvKL4HA60h97c5XaQ.png" /><figcaption>First time retrieves data. It took 11ms</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ap-PRF_pKPfnEewxKYtaaA.png" /><figcaption>Next, we retried to get data, It took 5ms.</figcaption></figure><h4>Code</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6e2554992ae5186c3e20cebb2b71f526/href">https://medium.com/media/6e2554992ae5186c3e20cebb2b71f526/href</a></iframe><p><strong><em>Check out Upstash for production: </em></strong><a href="https://upstash.com/"><strong><em>https://upstash.com/</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88efbe39eea2" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/introduction-to-redis-and-caching-with-node-js-using-upstash-88efbe39eea2">Introduction to Redis and Caching with Node.js using Upstash</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build A ToDo App Using GraphQL And Node.js]]></title>
            <link>https://javascript.plainenglish.io/build-a-todo-app-using-graphql-and-node-js-59d16feef60f?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/59d16feef60f</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[graphql]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Sat, 28 Nov 2020 07:29:09 GMT</pubDate>
            <atom:updated>2020-11-28T07:29:09.656Z</atom:updated>
            <content:encoded><![CDATA[<h4>Part 1: Implementing A Backend Service</h4><p>Let’s build a ToDo MERN app using GraphQL and Node.js, In this part, we will implement a backend service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rCubdBhrW7XlUiyd" /><figcaption>Photo by <a href="https://unsplash.com/@elisebouet?utm_source=medium&amp;utm_medium=referral">Elise Bouet</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Introduction</h4><p>In this article, we will create a backend service with GraphQL i.e Apollo Server and MongoDB database.</p><p>We will be using the MongoDB database so make sure you install it locally or you can use free <a href="https://www.mongodb.com/cloud/atlas">cloud</a> service from MongoDB.</p><p>By creating this App, you will learn</p><ul><li>How to design GraphQL schema.</li><li>How to design Queries and Mutations.</li><li>How to build a CRUD app using GraphQL API.</li></ul><h4>Initial Setup</h4><p>Create a new project using npm</p><p>npm init -y</p><p>This command will set the default value in package.json</p><p>Once the project is created, install the necessary dependencies</p><p>npm i apollo-server mongoose graphql dotenv</p><h4>Creating Initial Files</h4><p>Create a new file with the name server.js in the root directory of the project.</p><p>Don’t forget to add .env file too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/1*KQ5lTgZ6gEFCAomqEHI_AQ.png" /><figcaption>Root Directory Structure</figcaption></figure><p>In this file, we are setting up our server. For now, we using dummy data for testing purposes.</p><p>Here, we defined GraphQL Schema and resolvers.</p><p>Every GraphQL server uses a <strong>schema</strong> to define the structure of data that clients can query.</p><p><strong>Resolvers</strong> tell the GraphQL Server to fetch data associated with a particular type.</p><p>Note: Currently we using a <strong>dummy schema.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d75a146036fc366641214c14b0fc8c2b/href">https://medium.com/media/d75a146036fc366641214c14b0fc8c2b/href</a></iframe><p>Let’s run and check, to run this file node server.js</p><h4>Setting up the database</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c56603160a0eefa54c6743a8f536b5e3/href">https://medium.com/media/c56603160a0eefa54c6743a8f536b5e3/href</a></iframe><p>Here process.env.DATABASE_URL holds actual database server address in .env the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*0qTrTwN-lNvaofKmPULPSg.png" /><figcaption>.env</figcaption></figure><h4>Design Mongoose Model</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/567614d86dbe642c200b84a486676134/href">https://medium.com/media/567614d86dbe642c200b84a486676134/href</a></iframe><h4>Design GraphQL schema for ToDo</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0249bd7768c8b7c58dd6c1ff61525987/href">https://medium.com/media/0249bd7768c8b7c58dd6c1ff61525987/href</a></iframe><p>A type defines the queriable fields for every ToDo in our database and input defines the input structure for the data.</p><p>Mutation types define the entry point for a write operation.</p><p>GraphQL supports scalar type out of the box: ID , String , Boolean , Int and Float .</p><p>Queries and Mutation accept arguments of type scalar and custom.</p><h4>Create resolvers</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/acecb794b1f9aa66e34e75c83f2ee413/href">https://medium.com/media/acecb794b1f9aa66e34e75c83f2ee413/href</a></iframe><p>Resolvers will accept arguments from the client.</p><h4>Running app</h4><p>Run app using node server.js</p><p>As you can see here. Documentation created for you in IDE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UFe4IXLPf4kMPmgUuAx8FA.png" /><figcaption>GraphQL Server running</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b38a571286c42c7b2b5aad1cc1c8cac5/href">https://medium.com/media/b38a571286c42c7b2b5aad1cc1c8cac5/href</a></iframe><h4>Code: <a href="https://github.com/pprathameshmore/todo-graphql-mern-app">https://github.com/pprathameshmore/todo-graphql-mern-app</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59d16feef60f" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/build-a-todo-app-using-graphql-and-node-js-59d16feef60f">Build A ToDo App Using GraphQL And Node.js</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top-Level Await support in Node.js v14.3.0]]></title>
            <link>https://pprathameshmore.medium.com/top-level-await-support-in-node-js-v14-3-0-8af4f4a4d478?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8af4f4a4d478</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[asynchronous]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Mon, 25 May 2020 08:26:27 GMT</pubDate>
            <atom:updated>2025-12-12T15:06:41.008Z</atom:updated>
            <content:encoded><![CDATA[<h3>Developers Asked for It - Node.js 14.3 Delivered: Top-Level Await</h3><p>The current version of Node.js added support for Top-Level Await just like Deno.js, and other languages like C#.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*djska53bNeXkyPv3" /><figcaption>Photo by <a href="https://unsplash.com/@sannisahil?utm_source=medium&amp;utm_medium=referral">Sanni Sahil</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Now, It’s now possible to use the await keyword outside of async functions.</p><p>Let’s take a look at an example.</p><p>We will fetch a quote from API.</p><h4>Installation:</h4><p>Download and Install Node.js v14.3.0</p><p><a href="https://nodejs.org/en/download/current/">Download | Node.js</a></p><h4>Setup:</h4><p>Create Node.js project using :</p><p>npm init — yes</p><p>Now install the Axios library for fetching data from API.</p><p>npm install axios --save</p><p>Now modify apackage.json file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c786152a693cbc0600853f244213712e/href">https://medium.com/media/c786152a693cbc0600853f244213712e/href</a></iframe><p>Take a look here, we added type as module . Because the language has not fully implemented it yet <a href="https://github.com/tc39/proposal-top-level-await">stage 3</a>.</p><p>Code goes like this,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e92d9fe499857d1b3d02011102218c5c/href">https://medium.com/media/e92d9fe499857d1b3d02011102218c5c/href</a></iframe><p>Running this file using node --harmony-top-level-await top-level-async-await.js .</p><h4>Output:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*gy_hYJ1gYFUpK38wQyxh-w.png" /><figcaption>Response from server</figcaption></figure><p>Thank you.</p><p><a href="https://pprathameshmore.github.io/#">https://pprathameshmore.github.io/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8af4f4a4d478" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is it really Node.js single-threaded? Threading in Node.js]]></title>
            <link>https://pprathameshmore.medium.com/is-it-really-node-js-single-threaded-threading-in-node-js-227177c42d5a?source=rss-8211f67416b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/227177c42d5a</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Prathamesh More]]></dc:creator>
            <pubDate>Thu, 07 May 2020 13:27:23 GMT</pubDate>
            <atom:updated>2020-05-07T13:27:23.520Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we will create a thread for CPU extensive tasks that not blocking the main event loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eQw-MIVRwy6CYvvp" /><figcaption>Photo by <a href="https://unsplash.com/@grohsfabian?utm_source=medium&amp;utm_medium=referral">Fabian Grohs</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As we know, Node.js is a JavaScript runtime environment and runs the V8 JavaScript engine, the core of Google Chrome, outside of the browser.</p><p>A Node.js app is run in a single process and JavaScript doesn’t support threading, then How we can do CPU extensive and long-running tasks without blocking the main event loop?</p><blockquote>Is it really Node.js single-threaded?</blockquote><blockquote>Not really, Your JavaScript is not support threading but not Node.js, Node.js internally uses C++, recent addition of Node.js added support for worker_threads .</blockquote><figure><img alt="threading" src="https://cdn-images-1.medium.com/max/1024/1*gx4wBkLP3_9JKew0Dn-fgg.png" /><figcaption>Threading in Node.js</figcaption></figure><p>Each worker thread instance is really new instance of the event loop. Creating a new worker thread effectively gives a new event loop.</p><p>The following code demonstrates that, wasteTime() function-blocking from executing other code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5ab368ab7ffa0940933996039b472ac/href">https://medium.com/media/e5ab368ab7ffa0940933996039b472ac/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*AQLp77274BvmzHeNBY2lYQ.gif" /><figcaption>using main thread</figcaption></figure><p>Now we can fix this using worker threads, we will create worker thread for wasteTime() .</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ba051da13151db7124456812f3a6257/href">https://medium.com/media/0ba051da13151db7124456812f3a6257/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*x3SHIf5IGaImOsGSnim8rA.gif" /><figcaption>Using worker thread</figcaption></figure><p>You can see the right away that the main event loop not blocked this time. We immediately got output from the main thread. It’s time worker thread’s event loop blocked by wasteTime() . After completing the processing worker thread passes a message to the main thread.</p><p>Note: Workers (threads) are useful for performing CPU-intensive JavaScript operations. They will not help much with I/O-intensive work. Node.js’s built-in asynchronous I/O operations are more efficient than Workers can be.</p><p>Contact : <a href="https://pprathameshmore.github.io/#">https://pprathameshmore.github.io/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=227177c42d5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>