<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nikhil karkra</title>
    <description>The latest articles on DEV Community by Nikhil karkra (@karkranikhil).</description>
    <link>https://dev.to/karkranikhil</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F72253%2F24082bce-8a37-465e-a138-d168559f80af.jpg</url>
      <title>DEV Community: Nikhil karkra</title>
      <link>https://dev.to/karkranikhil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karkranikhil"/>
    <language>en</language>
    <item>
      <title>The Developer’s Guide to the 2026 Salesforce AI Revolution: Beyond the CRM</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Sun, 11 Jan 2026 13:43:46 +0000</pubDate>
      <link>https://dev.to/karkranikhil/the-developers-guide-to-the-2026-salesforce-ai-revolution-beyond-the-crm-4hc0</link>
      <guid>https://dev.to/karkranikhil/the-developers-guide-to-the-2026-salesforce-ai-revolution-beyond-the-crm-4hc0</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1677442136019-21780ecad995%3Fauto%3Dformat%26fit%3Dcrop%26w%3D1200%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1677442136019-21780ecad995%3Fauto%3Dformat%26fit%3Dcrop%26w%3D1200%26q%3D80" alt="Header Image" width="1200" height="675"&gt;&lt;/a&gt;&lt;br&gt;
The Salesforce AI Revolution: Why "Internal Only" Agents are a Thing of the Past. The conversation around &lt;strong&gt;Salesforce AI&lt;/strong&gt; is changing. In 2026, the real winners aren't just building agents for internal users; they are deploying them directly onto external websites to meet customers where they live.&lt;/p&gt;

&lt;p&gt;If you are a developer or architect, the ability to break out of the "Salesforce Walled Garden" is the most valuable skill you can add to your toolkit this year.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Paradigm Shift
&lt;/h2&gt;

&lt;p&gt;We’ve all seen the demos of AI helping employees inside the Service Console. But the true ROI for businesses happens when that same AI intelligence is embedded into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Public-facing WordPress sites&lt;/li&gt;
&lt;li&gt;Custom React/Next.js applications&lt;/li&gt;
&lt;li&gt;Client portals and E-commerce storefronts&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why "Deployment" is the New "Development"
&lt;/h2&gt;

&lt;p&gt;Knowing how to prompt an AI is easy. Knowing how to &lt;strong&gt;securely deploy&lt;/strong&gt; it to a third-party domain is where the real challenge lies. The market is currently starving for professionals who understand:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cross-Platform Security:&lt;/strong&gt; Managing CORS, CSP, and Trusted Sites to ensure your agent actually loads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Identity &amp;amp; Context:&lt;/strong&gt; Ensuring the AI knows exactly who it's talking to, even outside of Salesforce.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agentic Action:&lt;/strong&gt; Building agents that don't just "talk," but execute real-world business logic via external triggers.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Don't Just Build—Deploy
&lt;/h2&gt;

&lt;p&gt;As the ecosystem shifts toward &lt;strong&gt;Agentforce&lt;/strong&gt;, being the person who can say, &lt;em&gt;"I can put our Salesforce AI on any website we own,"&lt;/em&gt; makes you indispensable. It moves you from a "System Admin" mindset to an &lt;strong&gt;AI Solutions Architect&lt;/strong&gt; mindset.&lt;/p&gt;

&lt;p&gt;I’ve spent months documenting the end-to-end process of bridging the gap between Salesforce metadata and external web environments. I’ve turned those insights into a streamlined, marketing-to-deployment masterclass.&lt;/p&gt;

&lt;h3&gt;
  
  
  🚀 Level Up Your Salesforce Career
&lt;/h3&gt;

&lt;p&gt;If you’re ready to stop watching demos and start launching live AI Agents on the web, join me in my latest deep-dive course:&lt;/p&gt;

&lt;blockquote&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;a href="https://www.udemy.com/course/build-deploy-salesforce-ai-agents-to-external-websites/?couponCode=NEWYEAR2026" rel="noopener noreferrer"&gt;Build &amp;amp; Deploy Salesforce AI Agents to External Websites&lt;/a&gt;&lt;/strong&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>salesforce</category>
      <category>ai</category>
      <category>career</category>
      <category>agentforce</category>
    </item>
    <item>
      <title>Building a Real-Time Project with LWC OSS and LWR</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Mon, 10 Jul 2023 11:24:24 +0000</pubDate>
      <link>https://dev.to/karkranikhil/building-a-real-time-project-with-lwc-oss-and-lwr-31o9</link>
      <guid>https://dev.to/karkranikhil/building-a-real-time-project-with-lwc-oss-and-lwr-31o9</guid>
      <description>&lt;h2&gt;
  
  
  Building a Real-Time Project with LWC OSS and LWR
&lt;/h2&gt;

&lt;p&gt;Are you ready to take your Lightning Web Component skills to the next level? Look no further! Salesforcetroop is thrilled to announce the launch of our brand new course, "Building a Real-Time Project with LWC OSS and LWR." In this comprehensive course, we will dive deep into the world of Lightning Web Components (LWC) and explore how LWC OSS extends their capabilities beyond Salesforce.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unleash the Power of LWC OSS
&lt;/h2&gt;

&lt;p&gt;LWC OSS opens up a world of possibilities for developers by enabling them to create standalone web applications and integrate with other platforms. With this course, you'll discover how to leverage the full potential of LWC OSS and build real-time projects that will impress both your clients and peers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You'll Learn
&lt;/h2&gt;

&lt;p&gt;Our course is designed to provide you with a hands-on learning experience, equipping you with the knowledge and skills necessary to build powerful web applications. Here are some key topics we'll cover:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Introduction to LWC OSS and its benefits&lt;/li&gt;
&lt;li&gt;Setting up your development environment&lt;/li&gt;
&lt;li&gt;Building reusable Lightning Web Components&lt;/li&gt;
&lt;li&gt;Integrating LWC OSS with salesforce lead form&lt;/li&gt;
&lt;li&gt;Implementing real-time functionality with Lightning Web Runtime (LWR)&lt;/li&gt;
&lt;li&gt;Deploying and hosting your LWC OSS application&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Exclusive Discount for Early Birds
&lt;/h2&gt;

&lt;p&gt;To celebrate the launch of our course, we're offering an exclusive discount for the first 5 days! Use coupon code "LWCOSS" during checkout to unlock this limited-time offer. Don't miss out on this opportunity to enhance your web development skills and stay ahead of the curve.&lt;/p&gt;

&lt;p&gt;Enroll now: &lt;a href="https://www.udemy.com/course/building-a-real-time-project-with-lwc-oss-and-lwr/?couponCode=LWCOSS"&gt;Building a Real-Time Project with LWC OSS and LWR&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Join Us on this Learning Journey
&lt;/h2&gt;

&lt;p&gt;We understand the importance of continuous learning and staying updated with the latest technologies. By joining our course, you'll be part of a supportive community of like-minded developers, all eager to grow their expertise in Lightning Web Components.&lt;/p&gt;

&lt;p&gt;Hurry! The discount is only available for a limited time. Don't miss your chance to boost your skills and unlock exciting opportunities in web development. Enroll now and embark on this exciting learning journey with Salesforcetroop.&lt;/p&gt;

&lt;p&gt;Let's build real-time projects with LWC OSS and take your web development skills to new heights! 💪&lt;/p&gt;

</description>
      <category>salesforce</category>
      <category>lwc</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Build 7 Real-Time Salesforce(LWC) Projects</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Sun, 08 Jan 2023 06:34:40 +0000</pubDate>
      <link>https://dev.to/karkranikhil/build-7-real-time-salesforcelwc-projects-25el</link>
      <guid>https://dev.to/karkranikhil/build-7-real-time-salesforcelwc-projects-25el</guid>
      <description>&lt;p&gt;The salesforce market is looking for a skilled resource, but developers need to gain practical skills in LWC. This course will help anyone who wants to practice LWC or is looking for a job but needs to showcase the projects. &lt;/p&gt;

&lt;p&gt;AVAIL 58% off from the below URL&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.udemy.com/course/zero-to-hero-with-real-time-salesforcelwc-projects/?couponCode=LWC_PROJECTS" rel="noopener noreferrer"&gt;https://www.udemy.com/course/zero-to-hero-with-real-time-salesforcelwc-projects/?couponCode=LWC_PROJECTS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this course, we will build 7 projects that can be used in your day-to-day life.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;BMI Calculator App&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpuwbubod4zpdj92iehj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbpuwbubod4zpdj92iehj.png" alt="Image description" width="800" height="1469"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Alarm Clock App&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8rasbgezz2m1fesbfs6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8rasbgezz2m1fesbfs6.png" alt="Image description" width="800" height="1047"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Currency Converter App&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzohsy8fcjrh4in06auz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzohsy8fcjrh4in06auz3.png" alt="Image description" width="800" height="985"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Weather App&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadpjgnn2xw63sgswq8eg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadpjgnn2xw63sgswq8eg.png" alt="Image description" width="792" height="1060"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Employee Survey App&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa0649khm8zm9v0xeyue.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwa0649khm8zm9v0xeyue.png" alt="Image description" width="800" height="966"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Note-taking App&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8wf4hkvb6bb3nidm4p5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8wf4hkvb6bb3nidm4p5i.png" alt="Image description" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Personal Portfolio&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu88etq4nu8gf586u7bk3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu88etq4nu8gf586u7bk3.png" alt="Image description" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>salesforce</category>
      <category>lwc</category>
      <category>apex</category>
    </item>
    <item>
      <title>Fix - Github password authentication was removed issue - MacOS/Windows</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Sat, 14 Aug 2021 06:42:04 +0000</pubDate>
      <link>https://dev.to/karkranikhil/fix-github-password-authentication-was-removed-issue-macos-windows-2ljn</link>
      <guid>https://dev.to/karkranikhil/fix-github-password-authentication-was-removed-issue-macos-windows-2ljn</guid>
      <description>&lt;p&gt;GitHub removed the Support for password authentication on August 13, 2021, and now we have to use a personal access token instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  For MAC OS
&lt;/h2&gt;

&lt;p&gt;Click on the Spotlight icon (magnifying glass) on the right side of the menu bar. Type Keychain access then press the Enter key to launch the app - In Keychain Access, search for github.com -- Find the internet password entry for github.com-- Edit or delete the entry accordingly - You are done&lt;/p&gt;

&lt;h2&gt;
  
  
  For Windows OS
&lt;/h2&gt;

&lt;p&gt;Go to Credential Manager from Control Panel - Windows Credentials - find git:&lt;a href="https://github.com"&gt;https://github.com&lt;/a&gt; - Edit - On Password replace with your Github Personal Access Taken -- You are Done&lt;/p&gt;

&lt;h2&gt;
  
  
  Video
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/s-CN4RaNq8A"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to create a personal access token
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token"&gt;https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Steps performed while Creating Starter Kit for Javascript development</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Wed, 21 Jul 2021 11:07:44 +0000</pubDate>
      <link>https://dev.to/karkranikhil/steps-performed-while-creating-starter-kit-for-javascript-development-5a6c</link>
      <guid>https://dev.to/karkranikhil/steps-performed-while-creating-starter-kit-for-javascript-development-5a6c</guid>
      <description>&lt;h2&gt;
  
  
  Benefits of Starter kit
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Reduce decision fatigue by standardizing a long list of agreed tools, patterns and practices&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Right thing becomes automatic&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Codifies the best practices learned&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rapid feedback by quick testing, linting and compilation erros&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automated checklist to avoid common mistakes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Below is the Starter kit Link that I have build
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://github.com/karkranikhil/nik-js-starter-kit-2021
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Editors and configuration
&lt;/h3&gt;

&lt;p&gt;We have the following options to choose from&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Visual Studio Code&lt;/li&gt;
&lt;li&gt;[ ] WebStrom&lt;/li&gt;
&lt;li&gt;[ ] Brackets&lt;/li&gt;
&lt;li&gt;[ ] Atoms&lt;/li&gt;
&lt;li&gt;[ ] etc&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We choose the editor based on the following points&lt;br&gt;
1) Modern JavaScript Syntax support&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Autocompletion&lt;/li&gt;
&lt;li&gt;Report usnused/invalid imports&lt;/li&gt;
&lt;li&gt;Automated Refactoring tool like rename or extract functions
2) Framework intelligence
-like built-in node debugging
3) Built-in terminal&lt;/li&gt;
&lt;li&gt;Having a terminal built in gives you a single window for everything
4) Rich plugins Ecosystem
5) Cost effective&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;
  
  
  Automated Formating
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Prettier - it automatically format your code on save&lt;/li&gt;
&lt;li&gt;[x] EditorConfig - It helps you to maintain consistent coding styles between different editors and IDEs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note** - In &lt;code&gt;editorConfig&lt;/code&gt; file we specify how editor should handle common settings like tabs vs spaces, indent size, line feeds, charsets and whitespaces.&lt;/p&gt;

&lt;p&gt;** Plugin installed in vscode after adding the file  &lt;code&gt;.editorconfig&lt;/code&gt; is mentioned below&lt;br&gt;
VS Marketplace Link: &lt;a href="https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig"&gt;https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Package Manager
&lt;/h3&gt;

&lt;p&gt;We have the following options to choose from&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] npm&lt;/li&gt;
&lt;li&gt;[ ] Yarn&lt;/li&gt;
&lt;li&gt;[ ] Bower&lt;/li&gt;
&lt;li&gt;[ ] JSPM&lt;/li&gt;
&lt;li&gt;[ ] Jam&lt;/li&gt;
&lt;li&gt;[ ] volo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npm&lt;/code&gt; is the larget package manager in the workd with over 1 million packages.&lt;/p&gt;


&lt;h3&gt;
  
  
  Security Scanning by npm
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Audits are built into npm that gives us the warning message if there is a known vulnerability in a package
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm audit --fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Development web server
&lt;/h3&gt;

&lt;p&gt;We have the following options to choose from&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Express&lt;/li&gt;
&lt;li&gt;[ ] http-server&lt;/li&gt;
&lt;li&gt;[ ] Webpack dev server&lt;/li&gt;
&lt;li&gt;[ ] Browsersync&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We configure our webserver so it's aautomatically started as a part of our development process and open our application so we can review our results immedietly on browser.&lt;/p&gt;

&lt;p&gt;We are choosing server that's focused on javascript local development, highly configurable and powerful&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;http-server&lt;/th&gt;
&lt;th&gt;Express&lt;/th&gt;
&lt;th&gt;webpack dev server&lt;/th&gt;
&lt;th&gt;Browsersync&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Ultra-simple&lt;/td&gt;
&lt;td&gt;Comprehensive&lt;/td&gt;
&lt;td&gt;Built in to web server&lt;/td&gt;
&lt;td&gt;Dedicated IP for sharing work on LAN&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Single command serves current directory&lt;/td&gt;
&lt;td&gt;Highly Configurable&lt;/td&gt;
&lt;td&gt;Serves form memory&lt;/td&gt;
&lt;td&gt;All interactions remain in sync&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;No configuration&lt;/td&gt;
&lt;td&gt;Production gradeProduction grade&lt;/td&gt;
&lt;td&gt;includes hot reloading&lt;/td&gt;
&lt;td&gt;Great for cross-device testing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;Can run it everywhere&lt;/td&gt;
&lt;td&gt;Integrate with gulp, webpack etc&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h3&gt;
  
  
  Sharing work with url
&lt;/h3&gt;

&lt;p&gt;If you want to quickly share your work on the public web so your client can review your work in progress without paying anything&lt;/p&gt;

&lt;p&gt;We have the following options to choose from&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] localtunnel&lt;/li&gt;
&lt;li&gt;[ ] ngrok&lt;/li&gt;
&lt;li&gt;[ ] Surge&lt;/li&gt;
&lt;li&gt;[ ] Vercel&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;localtunnel&lt;/th&gt;
&lt;th&gt;ngrok&lt;/th&gt;
&lt;th&gt;vercel&lt;/th&gt;
&lt;th&gt;Surge&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Easily share work on your local machine&lt;/td&gt;
&lt;td&gt;Secure tunnel to your local machine&lt;/td&gt;
&lt;td&gt;quickly deploy Node.js to cloud&lt;/td&gt;
&lt;td&gt;Quickly host static files to public URL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;npm install localtunnel -g&lt;/td&gt;
&lt;td&gt;require additional setup to achive extra power&lt;/td&gt;
&lt;td&gt;Each time you deploy, you're assigned to a new unique URL&lt;/td&gt;
&lt;td&gt;Extreme simple, Surge publishes your static files to their services and then serves them to public url&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;npm install localtunnel -g&lt;/code&gt;,  &lt;code&gt;lt --port 3000 --subdomain nik&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Sign up, &lt;code&gt;install ngrok&lt;/code&gt;, install authtoken, start your app, ./ngrok http 80&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;npm install -g vercel&lt;/code&gt;, create start script, vercel&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;npm install -g surge&lt;/code&gt;,  surge&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Surge and Vercel is permanent solution, you don't have to keep your machine open until people to see your work in progress but surge only supports static fiels.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vercel also support node js projects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note** we are using localtunnel&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install localtunnel -g
lt --port 3000 --subdomain nik
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running above command you will get the&lt;br&gt;
url&lt;/p&gt;




&lt;h3&gt;
  
  
  Automation tools
&lt;/h3&gt;

&lt;p&gt;We have the following options to choose from&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] npm scripts&lt;/li&gt;
&lt;li&gt;[ ] Grunt&lt;/li&gt;
&lt;li&gt;[ ] Gulp&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;npm scripts are declared in the script section of your package.json file. With npm scripts you can directly leverage all the power of operating system command line.&lt;/p&gt;

&lt;p&gt;npm scripts also offer convention based hooks for running other scripts before and after your scripts&lt;/p&gt;




&lt;h3&gt;
  
  
  Transpiling
&lt;/h3&gt;

&lt;p&gt;We have the following options to choose from&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Babel&lt;/li&gt;
&lt;li&gt;&lt;p&gt;[ ] TypeScript&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;babel&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Write standardized JS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Leverage full JS Ecosystem&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use experimental features earlier&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No type defs, annotation required&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;typescript&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced Automcomplete&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enhanced readability&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Safer refactoring&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Additional non standard featires&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It has own complier but we can use babel to compile TypeScript&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@babel/preset-env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This package is a smart preset that compiles our JS down to run in all recent browsers&lt;/p&gt;




&lt;h4&gt;
  
  
  Babel Configuration Styles
&lt;/h4&gt;

&lt;p&gt;-- Using &lt;code&gt;.babelrc&lt;/code&gt; --&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Most common approach in which we place this file at the root dorectory of the project&lt;/li&gt;
&lt;li&gt;not npm specific&lt;/li&gt;
&lt;li&gt;Easier to read since isolated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-- Using &lt;code&gt;package.json&lt;/code&gt; --&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One less file in your project&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;"babel":{}&lt;/code&gt; need to add this in package.json
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  "targets":"&amp;gt;0.25%, not dead"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  above config tells babel, to support all browser used by more that .25% people that are still officially supported by their creator
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Modules formats
&lt;/h3&gt;

&lt;p&gt;We have different type of modules formats&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] ES6 Modules&lt;/li&gt;
&lt;li&gt;[ ] CommonJS (CJS)&lt;/li&gt;
&lt;li&gt;[ ] UMD (Universal Module Definition)&lt;/li&gt;
&lt;li&gt;[ ] AMD (Asynchronous Module Definition)&lt;/li&gt;
&lt;li&gt;&lt;p&gt;[ ] IIFE (Immediately-invoked function expressions)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ES6 modules are standardized&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cleaner, Easy to read, improved autocomplete&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;intelligent refactoring&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tree Shaking - dead code elimination&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Named imports and Default exports&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CommonJS doesn't work in web browser aand so we need to bundle npm packages into a format that the browser can consume
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Bundling
&lt;/h3&gt;

&lt;p&gt;We use bundler to package any JavaScript into a single file or seperate file.&lt;/p&gt;

&lt;p&gt;We have different type of modules formats&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Webpack&lt;/li&gt;
&lt;li&gt;[ ] Rollup&lt;/li&gt;
&lt;li&gt;[ ] Parcel&lt;/li&gt;
&lt;li&gt;[ ] Snowpack&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  - [ ] Browserify
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Webpack bundles more than just JS&lt;/li&gt;
&lt;li&gt;Webpack offers a huge ecosystem of loaders so you can easily so we can instruct webpack to intelligently handle html, CSS, Images, fonts, etc&lt;/li&gt;
&lt;li&gt;Webpack includes built in hot-reloading web server&lt;/li&gt;
&lt;li&gt;Webpack serve files from memory which speeds up the development builds and automatically updates&lt;/li&gt;
&lt;li&gt;code spliting&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Sourcemaps
&lt;/h3&gt;

&lt;p&gt;Sourcemaps map the bundled, transpiled and minified code back to orignal source.&lt;/p&gt;




&lt;h3&gt;
  
  
  Linting
&lt;/h3&gt;

&lt;p&gt;Linters are so powerful that they can catch many errors at compile time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linters programmatically enforce consistency and provide raapid feedbaack to catch error during development.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example - Curly braces position, trailing commas, Global variable, stop eval etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Linter avoid mistakes like Overwriting functions, assignment in conditional, Extra parenthesis&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We have the following options to choose from&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Eslint&lt;/li&gt;
&lt;li&gt;[ ] JSLint&lt;/li&gt;
&lt;li&gt;[ ] JSHint&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ESlint Decisions
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Config format&lt;/li&gt;
&lt;li&gt;WHich built in rules&lt;/li&gt;
&lt;li&gt;warning or errors&lt;/li&gt;
&lt;li&gt;Which plugins&lt;/li&gt;
&lt;li&gt;Use preset instead&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Config format&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;.eslintrc.js - export and object containing configuration&lt;/li&gt;
&lt;li&gt;.eslintrc.yaml - define configuration structure&lt;/li&gt;
&lt;li&gt;.eslintrc.yml - define configuration structure&lt;/li&gt;
&lt;li&gt;.eslintrc.json - define configuration structure in JSON format&lt;/li&gt;
&lt;li&gt;.eslintrc - deprecated&lt;/li&gt;
&lt;li&gt;package.json - create &lt;code&gt;eslintConfig&lt;/code&gt; property in package.json&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;warning vs erros&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;warning can continue development, caan be ignored&lt;/li&gt;
&lt;li&gt;erros breaks the build and can't be ignored&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;eslint plugins&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/dustinspecker/awesome-eslint"&gt;https://github.com/dustinspecker/awesome-eslint&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use a preset&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ESlint comes with lot of logical defaults that save you a lot of time. We can use an existing set of rules like airbnbs, xo etc&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;Note&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
ESLint doesn't watch files&lt;/p&gt;

&lt;p&gt;&lt;code&gt;eslint-watch&lt;/code&gt;is a npm packages that adds file waatch&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;Note&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
ESLint doesn't supports experimental feature for that we have to use &lt;code&gt;babel-eslint&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Unit testing focus on testing of single function or module in an automated fashion.&lt;/li&gt;
&lt;li&gt;Unit tests often asserts that a certain function return an expected value when past certain parameters&lt;/li&gt;
&lt;li&gt;Unit tests mock out external dependencies like APIs database calls, and fiile system interactions so the results are fast and deterministic&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Unit Testing Decisions
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Framework&lt;/li&gt;
&lt;li&gt;Assertion Library&lt;/li&gt;
&lt;li&gt;Helper LIbraries&lt;/li&gt;
&lt;li&gt;Where to run test&lt;/li&gt;
&lt;li&gt;Where to places test&lt;/li&gt;
&lt;li&gt;When to run tests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;We have the following options to choose from Frameworks&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Mocha&lt;/li&gt;
&lt;li&gt;[ ] Mocha&lt;/li&gt;
&lt;li&gt;[ ] Jasmine&lt;/li&gt;
&lt;li&gt;[ ] QUnit&lt;/li&gt;
&lt;li&gt;[ ] Ava&lt;/li&gt;
&lt;li&gt;[ ] Jest&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I aam using MOchaa because it's popular, mature, flexible and large ecosystem of support&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We have the following options to choose from Assertion library&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Chai&lt;/li&gt;
&lt;li&gt;[ ] Should.js&lt;/li&gt;
&lt;li&gt;[ ] expect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;We have the following options to choose from Helper library&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] JSDOM - simulate the browser's DOM and also run DOM-related tests without a browser&lt;/li&gt;
&lt;li&gt;[ ] Cheerio - jQuery for Server&lt;/li&gt;
&lt;li&gt;[ ] expect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Where to RUN TEST&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] In-memory DOM - JSDOM (lightweight alternative to headless chrome)&lt;/li&gt;
&lt;li&gt;[ ] Browser - Karma, Testem&lt;/li&gt;
&lt;li&gt;[ ] Headless Browser - A browser that doesn't have a visible user interface&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Where to put test files&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Alongside - keep in same folder, Easy import, provides clear visibility&lt;/li&gt;
&lt;li&gt;[ ] Centeralized - Less confusion in src folder, too much path confusions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Where should our Unit test run&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] On Hit Save - Rapid feedback, Facilitates TDD, increase test visibility&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Continuous Integration
&lt;/h3&gt;

&lt;p&gt;When your team commits code it's handy to confirm immediately that the commit works as expected when on another machine that's what a CI server is for.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CI server catches the number of potentials mistakes like

&lt;ul&gt;
&lt;li&gt;Forgot to commit new files&lt;/li&gt;
&lt;li&gt;forgot to update package.json&lt;/li&gt;
&lt;li&gt;commit doesn't run cross platform&lt;/li&gt;
&lt;li&gt;Node version conflicts&lt;/li&gt;
&lt;li&gt;Bad merge&lt;/li&gt;
&lt;li&gt;Didn't run tests&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;


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

&lt;h4&gt;
  
  
  Continuous Integration Server
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Run automated build&lt;/li&gt;
&lt;li&gt;Run your tests&lt;/li&gt;
&lt;li&gt;Check code coverage&lt;/li&gt;
&lt;li&gt;Automated deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;We have the following options to choose&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Travis CI - Linux based&lt;/li&gt;
&lt;li&gt;[ ] Appveyor - Windows based&lt;/li&gt;
&lt;li&gt;[ ] Jenkins&lt;/li&gt;
&lt;li&gt;[ ] circle CI&lt;/li&gt;
&lt;li&gt;[ ] Semaphore&lt;/li&gt;
&lt;li&gt;[ ] SnapCI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Travis and Jenkins are the most popular solution but Travis is the hosted solution and with jenkins you have to host your CI server your own&lt;/p&gt;

&lt;h4&gt;
  
  
  HTTP Calls
&lt;/h4&gt;

&lt;p&gt;Every Javascript application we build today makes HTTP Calls&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We have the following options to choose&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] http - Node&lt;/li&gt;
&lt;li&gt;[ ] request - Node&lt;/li&gt;
&lt;li&gt;[ ] XMLHttpRequest - Browser&lt;/li&gt;
&lt;li&gt;[ ] $.Ajax - Browser&lt;/li&gt;
&lt;li&gt;[x] Fetch - Browser&lt;/li&gt;
&lt;li&gt;[ ] isomorphic-fetch - run both on Node &amp;amp; Browser&lt;/li&gt;
&lt;li&gt;[ ] xhr - run both on Node &amp;amp; Browser&lt;/li&gt;
&lt;li&gt;[ ] Axios - run both on Node &amp;amp; Browser&lt;/li&gt;
&lt;li&gt;[ ] SuperAgent - run both on Node &amp;amp; Browser&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Mocking HTTP Calls
&lt;/h4&gt;

&lt;p&gt;It means that you can recieve consistently instantaneous responses.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helps in rapid prototyping&lt;/li&gt;
&lt;li&gt;Helps to keep the work up and running when services are down&lt;/li&gt;
&lt;li&gt;Work offline&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;We have the following options to choose&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Nock&lt;/li&gt;
&lt;li&gt;[ ] Static JSON&lt;/li&gt;
&lt;li&gt;[x] JSON server&lt;/li&gt;
&lt;li&gt;[ ] api-mock&lt;/li&gt;
&lt;li&gt;[x] JSON Schema faker&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Generate Random Data
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;faker.js&lt;/li&gt;
&lt;li&gt;chance.js&lt;/li&gt;
&lt;li&gt;randexp.js&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Demo App
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Directory structure and file naming&lt;/li&gt;
&lt;li&gt;Framework usafe&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;li&gt;Mock API&lt;/li&gt;
&lt;li&gt;Automated deployment&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Production Build
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Minification&lt;/strong&gt; to speed page loads&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sourcemaps&lt;/strong&gt; to support debugging in production&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic HTML&lt;/strong&gt; to handle prooduction-specific concerns&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache busting&lt;/strong&gt; to ensure user recieve latest code on deployment&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bundle splitting&lt;/strong&gt; to ensure users don't have to download the entire application when just part of changes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error logging&lt;/strong&gt; to see bugs in productions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Minification
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It is used to speed up the page load and save bandwidth&lt;/li&gt;
&lt;li&gt;Shortern varibale and function names&lt;/li&gt;
&lt;li&gt;removes comments&lt;/li&gt;
&lt;li&gt;removes whitespaces and new lines&lt;/li&gt;
&lt;li&gt;Dead code elimination/Tree shakig&lt;/li&gt;
&lt;li&gt;Debug via sourcemap&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Dynamic HTML
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Reference bundles automatically&lt;/li&gt;
&lt;li&gt;Handle dynamic bundle name&lt;/li&gt;
&lt;li&gt;inject production only resources&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bundle Splitting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Speed initial page load&lt;/li&gt;
&lt;li&gt;Avoid re-loading all libraries&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cache Busting
&lt;/h2&gt;

&lt;p&gt;This mean after someone downloads your javascript file they won't make another HTTP request for that file  up to one year&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save HTTP requests&lt;/li&gt;
&lt;li&gt;force request for latest version&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Error logging
&lt;/h2&gt;

&lt;p&gt;[x] track.js&lt;/p&gt;

&lt;p&gt;TrackJS makes finding and fixing client-side errors simple.&lt;/p&gt;

&lt;p&gt;choose logging serve based on the following points&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;provide bettwe metadata like stack trace, previous action, custom api for enhanced tracking&lt;/li&gt;
&lt;li&gt;Notification &amp;amp; integration&lt;/li&gt;
&lt;li&gt;Analytics and filteriing&lt;/li&gt;
&lt;li&gt;pricing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Seperate UI and API
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Simple, low risk and ui only deploy&lt;/li&gt;
&lt;li&gt;Seperate teams and sperates concerns&lt;/li&gt;
&lt;li&gt;Scale back-end separately&lt;/li&gt;
&lt;li&gt;UI hosting is cheap and handling is easy independently&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Cloud hosting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[] AWS&lt;/li&gt;
&lt;li&gt;[ ] Azure&lt;/li&gt;
&lt;li&gt;[X] Heroku - Used for API&lt;/li&gt;
&lt;li&gt;[ ] Firebase&lt;/li&gt;
&lt;li&gt;[x] Surge - used for UI&lt;/li&gt;
&lt;li&gt;[ ] Netlify&lt;/li&gt;
&lt;li&gt;[ ] Heroku&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>NASA Mission Control Deno Project</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Wed, 22 Jul 2020 00:10:15 +0000</pubDate>
      <link>https://dev.to/karkranikhil/nasa-mission-control-deno-project-em0</link>
      <guid>https://dev.to/karkranikhil/nasa-mission-control-deno-project-em0</guid>
      <description>&lt;p&gt;If you are learning Deno. Somi Jaiswal has built the NASA mission control project using Denojs. It's really interesting to see people are growing so fast in the Deno world.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/posts/somi-jaiswal-1931174a_deno-deno-learning-activity-6691392113403400192-3B_n"&gt;https://www.linkedin.com/posts/somi-jaiswal-1931174a_deno-deno-learning-activity-6691392113403400192-3B_n&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below is the demo of the app&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/98VAt7ENdgA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>deno</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>node</category>
    </item>
    <item>
      <title>Why to use Deno?.</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Fri, 19 Jun 2020 04:18:20 +0000</pubDate>
      <link>https://dev.to/karkranikhil/why-to-use-deno-over-other-programming-languages-1jjd</link>
      <guid>https://dev.to/karkranikhil/why-to-use-deno-over-other-programming-languages-1jjd</guid>
      <description>&lt;h2&gt;
  
  
  What is Deno?
&lt;/h2&gt;

&lt;p&gt;Deno is a simple, modern, and secure runtime environment for Javascript and Typescript that uses V8 engine and builds with Rust Programming language.&lt;/p&gt;

&lt;p&gt;Like any other language, it is used to build backend services or Application Programming interfaces(API) which are used in Web and Mobile applications. It is also used for communicating the database, sending an email, or storing a file on the server.&lt;/p&gt;

&lt;p&gt;so, the question is Why Deno.&lt;/p&gt;

&lt;h3&gt;
  
  
  Below are the features that makes the difference.
&lt;/h3&gt;

&lt;h3&gt;
  
  
  1. Easy
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Deno is Easy to get started&lt;/li&gt;
&lt;li&gt;No need for prior knowledge &lt;/li&gt;
&lt;li&gt;Really amazing for prototyping and agile development.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Fast, Reusable and Scalable
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Deno is useful for creating a superfast application.&lt;/li&gt;
&lt;li&gt;It is highly reusable and scalable&lt;/li&gt;
&lt;li&gt;faster requests speed and response time&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Save time
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Deno save time in development&lt;/li&gt;
&lt;li&gt;40%  percent of fewer lines of code&lt;/li&gt;
&lt;li&gt;40% fewer files&lt;/li&gt;
&lt;li&gt;It has many Built-in utilities like dependency inspector, Deno formatter, and so on...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reference - &lt;a href="https://news.ycombinator.com/item?id=18058571"&gt;https://news.ycombinator.com/item?id=18058571&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Secure by default
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No file or network or environment access unless you have enabled it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. No Package manager
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In Deno, you don't have to install big node_modules&lt;/li&gt;
&lt;li&gt;When you called the library which you need it automatically cached on the file system.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. Typescript
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;It Supports TypeScript out of the box.&lt;/li&gt;
&lt;li&gt;If you know TypeScripe you can become easily full stack developer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;References&lt;br&gt;
&lt;a href="https://deno.land/"&gt;https://deno.land/&lt;/a&gt; &lt;br&gt;
&lt;a href="https://dev.to/somijaiswal23/building-blocks-of-deno-3f2"&gt;https://dev.to/somijaiswal23/building-blocks-of-deno-3f2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k3FxyXhN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ulygjcf5tay9rro94bev.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k3FxyXhN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ulygjcf5tay9rro94bev.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>typescript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Dashboard to track the Coronavirus Disease (COVID-19) Statistics using the Lightning Web Component. </title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Tue, 17 Mar 2020 00:58:40 +0000</pubDate>
      <link>https://dev.to/karkranikhil/dashboard-to-track-the-coronavirus-disease-covid-19-statistics-using-the-lightning-web-component-fai</link>
      <guid>https://dev.to/karkranikhil/dashboard-to-track-the-coronavirus-disease-covid-19-statistics-using-the-lightning-web-component-fai</guid>
      <description>&lt;p&gt;Hi Guys!! I have built a dashboard with a real-time API(of COVID-19) in Salesforce Playground using the Lightning web component.&lt;/p&gt;

&lt;h3&gt;
  
  
  Below is the design that I have built.
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ubLO6_g2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/s0m5fsb5ldcmwpzal3ex.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ubLO6_g2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/s0m5fsb5ldcmwpzal3ex.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n26f61Eh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8zdqtizqmf4w4xgdwxq6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n26f61Eh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/8zdqtizqmf4w4xgdwxq6.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developer.salesforce.com/docs/component-library/tools/playground/r03Vo4p4/3/edit"&gt;COVID-19 Global Cases Tracking Using LWC&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tutorial
&lt;/h2&gt;

&lt;p&gt;I have recorded the video so that you guys can follow and build the awesome stuff. In this tutorial, you will learn how to build a dashboard using lightning web components. we are going to use the following topics&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Data Binding&lt;/li&gt;
&lt;li&gt;Component lifecycle&lt;/li&gt;
&lt;li&gt;Third-party API Integration&lt;/li&gt;
&lt;li&gt;Looping&lt;/li&gt;
&lt;li&gt;Filtering&lt;/li&gt;
&lt;li&gt;Charts - Highcharts&lt;/li&gt;
&lt;li&gt;Tables&lt;/li&gt;
&lt;li&gt;SLDS inbuilt CSS classes
9Custom CSS&lt;/li&gt;
&lt;li&gt;Event handlers&lt;/li&gt;
&lt;li&gt;getters&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/6MuvWRJCsK0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Code and Demo
&lt;/h2&gt;

&lt;p&gt;GITHUB - &lt;a href="https://github.com/karkranikhil/COVID-19-Dashboard-using-lwc"&gt;https://github.com/karkranikhil/COVID-19-Dashboard-using-lwc&lt;/a&gt;&lt;br&gt;
PLAYGROUND - &lt;a href="https://developer.salesforce.com/docs/component-library/tools/playground/r03Vo4p4/3/edit"&gt;https://developer.salesforce.com/docs/component-library/tools/playground/r03Vo4p4/3/edit&lt;/a&gt;&lt;/p&gt;

</description>
      <category>salesforce</category>
      <category>javascript</category>
      <category>lwc</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Face recognition using JavaScript</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Fri, 14 Feb 2020 08:04:45 +0000</pubDate>
      <link>https://dev.to/karkranikhil/face-recognition-using-javascript-33n5</link>
      <guid>https://dev.to/karkranikhil/face-recognition-using-javascript-33n5</guid>
      <description>&lt;p&gt;Face detection is one of the most common applications of Artificial Intelligence. The use of Facial detection has increased in the last couple of years.&lt;/p&gt;

&lt;p&gt;Face-api.js has brought a JavaScript API for face detection and face recognition in the browser implemented on top of the tensorflow.js core API &lt;/p&gt;

&lt;p&gt;In this tutorial, we will build the face recognition app that will work in the Browser. From the face, we will predict the Emotion, Gender, and age.&lt;/p&gt;

&lt;p&gt;The output of this app will look as shown below.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fciicc6os9ze8tbz1iykb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fciicc6os9ze8tbz1iykb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Project Step
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Step1 - Create a folder called &lt;code&gt;face-recognition&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Under the &lt;code&gt;face-recognition&lt;/code&gt; folder create the following folder structure&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjexxen4ylpo2q0dwvpe3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjexxen4ylpo2q0dwvpe3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All folders are self-explanatory except models. That I will cover in going forward.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step2 - download the &lt;code&gt;face-api.min.js&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Download the &lt;code&gt;face-api.min.js&lt;/code&gt; code from the following URL and paste it inside the &lt;code&gt;js/face-api.min.js&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//raw.githubusercontent.com/karkranikhil/face-recognition-using-js/master/js/face-api.min.js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step3 - download the modal files
&lt;/h3&gt;

&lt;p&gt;Models are the trained data that we will use to detect the feature from the face.&lt;br&gt;
Download the files from the following URL and placed them inside the &lt;code&gt;models&lt;/code&gt; folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="c1"&gt;//github.com/karkranikhil/face-recognition-using-js/tree/master/models&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step4 - Let's built the &lt;code&gt;index.html&lt;/code&gt; file.
&lt;/h3&gt;

&lt;p&gt;In &lt;code&gt;index.html&lt;/code&gt; file we importing the &lt;code&gt;style.css&lt;/code&gt; for styles, &lt;code&gt;face-api.min.js&lt;/code&gt; for processing the model data and extracting the features and main.js where we will write our logic.&lt;br&gt;
Inside the &lt;code&gt;body&lt;/code&gt; tag we are creating a video tag to get the face, &lt;code&gt;result-container&lt;/code&gt; for showing the emotion, gender, and age.&lt;/p&gt;

&lt;p&gt;Place the below code inside the &lt;code&gt;index.html&lt;/code&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;http-equiv=&lt;/span&gt;&lt;span class="s"&gt;"X-UA-Compatible"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"ie=edge"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Face recognition App&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"css/style.css"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;Face recognition in the browser using Javascript&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;video&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"video"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"500"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"500"&lt;/span&gt; &lt;span class="na"&gt;autoplay&lt;/span&gt; &lt;span class="na"&gt;muted&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/video&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"result-container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"emotion"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Emotion&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"gender"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Gender&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"age"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Age&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./js/face-api.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./js/main.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step5 - Let's built the &lt;code&gt;main.js&lt;/code&gt; file.
&lt;/h3&gt;

&lt;p&gt;Inside the &lt;code&gt;main.js&lt;/code&gt; file we are using &lt;code&gt;promise.all&lt;/code&gt; to load the models to the face API. once the promise is resolved then we are calling the &lt;code&gt;startVideo&lt;/code&gt; method that starts the streaming. Below are the methods used for this demo&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;faceapi.detectSingleFace&lt;/code&gt; method - &lt;code&gt;detectSingleFace&lt;/code&gt; utilize the SSD Mobilenet V1 Face Detector. You can specify the face detector by passing the corresponding options object. To detect the multiple faces replace the &lt;code&gt;detectSingleFace&lt;/code&gt; with &lt;code&gt;detectAllFaces&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;withFaceLandmarks method&lt;/code&gt; - It is used for Detecting 68 Face Landmark Points&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;withFaceExpressions method&lt;/code&gt; - This method Detect all faces in an image + recognize facial expressions of each face and return the array&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;withAgeAndGendermethod&lt;/code&gt; - This method Detect all faces in an image + estimate age and recognize gender of each face and return the array&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Replace the following code to the &lt;code&gt;main.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;video&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isScreenSmall&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;(max-width: 700px)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;predictedAges&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

&lt;span class="cm"&gt;/****Loading the model ****/&lt;/span&gt;
&lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tinyFaceDetector&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loadFromUri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/models&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;faceLandmark68Net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loadFromUri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/models&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;faceRecognitionNet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loadFromUri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/models&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;faceExpressionNet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loadFromUri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/models&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;nets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ageGenderNet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loadFromUri&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/models&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;startVideo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;startVideo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getUserMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;video&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="nx"&gt;stream&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;srcObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/****Fixing the video with based on size size  ****/&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;screenResize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isScreenSmall&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isScreenSmall&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;320px&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;500px&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;screenResize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isScreenSmall&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;isScreenSmall&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;screenResize&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/****Event Listeiner for the video****/&lt;/span&gt;
&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;playing&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createCanvasFromMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;container&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.container&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;displaySize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;matchDimensions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;displaySize&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nf"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;detections&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;faceapi&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;detectSingleFace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;video&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;TinyFaceDetectorOptions&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;withFaceLandmarks&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;withFaceExpressions&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;withAgeAndGender&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;resizedDetections&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resizeResults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;detections&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;displaySize&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;clearRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="cm"&gt;/****Drawing the detection box and landmarkes on canvas****/&lt;/span&gt;
    &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawDetections&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;resizedDetections&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;faceapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;draw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawFaceLandmarks&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;resizedDetections&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="cm"&gt;/****Setting values to the DOM****/&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resizedDetections&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resizedDetections&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;resizedDetections&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;interpolatedAge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;interpolateAgePredictions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;gender&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;resizedDetections&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gender&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;expressions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;resizedDetections&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;expressions&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;maxValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;expressions&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;emotion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;expressions&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;expressions&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;maxValue&lt;/span&gt;
      &lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;age&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`Age - &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;interpolatedAge&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;gender&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`Gender - &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;gender&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;emotion&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`Emotion - &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;emotion&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;interpolateAgePredictions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;predictedAges&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;predictedAges&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;avgPredictedAge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="nx"&gt;predictedAges&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;predictedAges&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;avgPredictedAge&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step6 - Let's Add the style to the app.
&lt;/h3&gt;

&lt;p&gt;Replace the &lt;code&gt;style.css&lt;/code&gt; with the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-sizing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;border-box&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100vh&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#2f2f2f&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;100%&lt;/span&gt; &lt;span class="n"&gt;-&lt;/span&gt; &lt;span class="m"&gt;33px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;canvas&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;absolute&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.result-container&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;justify-content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;flex-direction&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.result-container&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;capitalize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;#age&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#1e94be&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;#emotion&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#8a1025&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;#gender&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#62d8a5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;video&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;header&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#42a5f5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step7 - Let's run the app by the live server or &lt;code&gt;http-server&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Once you run the app you will see the following output.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fciicc6os9ze8tbz1iykb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fciicc6os9ze8tbz1iykb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you can run the app deployed by me, using the following URL&lt;br&gt;
&lt;a href="https://face-recognition.karkranikhil.now.sh/" rel="noopener noreferrer"&gt;https://face-recognition.karkranikhil.now.sh/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Reference
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/justadudewhohacks/face-api.js/" rel="noopener noreferrer"&gt;https://github.com/justadudewhohacks/face-api.js/&lt;/a&gt;&lt;br&gt;
GITHUB - &lt;a href="https://github.com/karkranikhil/face-recognition-using-js" rel="noopener noreferrer"&gt;https://github.com/karkranikhil/face-recognition-using-js&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>GraphQL - React Apollo with Demo</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Fri, 31 Jan 2020 03:54:05 +0000</pubDate>
      <link>https://dev.to/karkranikhil/graphql-beginner-guide-to-react-apollo-with-demo-1b9l</link>
      <guid>https://dev.to/karkranikhil/graphql-beginner-guide-to-react-apollo-with-demo-1b9l</guid>
      <description>&lt;p&gt;I have built a basic Employee management application using React Apollo. It takes a lot of time for me to understand the terminologies used in react apollo. so, I thought of sharing some common methods and terms of Graphql apollo with you.&lt;/p&gt;

&lt;p&gt;Below is the demo of my app&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Xk9QltVrOxc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;You can checkout my code &lt;a href="https://github.com/karkranikhil/react-apollo-employee-api-demo" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Output of the Demo
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz14k1rv76mo4muuoc06k.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz14k1rv76mo4muuoc06k.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Component View of the App
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff9l1kip7bqvrr4p8yfhi.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ff9l1kip7bqvrr4p8yfhi.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Key React-apollo Terminologies used in the demo
&lt;/h3&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;HttpLink&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;HTTP Link takes an object with some options on it to customize the behavior of the link. If your server supports it, the HTTP link can also send over metadata about the request in the extensions field.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HttpLink&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;apollo-link-http&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;link&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HttpLink&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:1234/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;ApolloClient&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The Apollo Client constructor takes a small number of options, of which two are required. &lt;br&gt;
&lt;strong&gt;1. link&lt;/strong&gt; - Apollo Client requires an Apollo Link to serve as the network layer.&lt;br&gt;
&lt;strong&gt;2. cache&lt;/strong&gt; - The second required argument for using Apollo Client is an instance of an Apollo Cache. The recommended cache is the apollo-cache-inmemory which exports an { InMemoryCache }&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//client.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ApolloClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;apollo-client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;InMemoryCache&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;apollo-cache-inmemory&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;HttpLink&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;apollo-link-http&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;link&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HttpLink&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;uri&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:1234/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;InMemoryCache&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ApolloClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;link&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;cache&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;ApolloProvider&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;It is a component that leverages React's Context API to make a configured Apollo Client instance available throughout a React component tree.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//index.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./index.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./App&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ApolloProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@apollo/react-hooks&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;serviceWorker&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./serviceWorker&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ApolloProvider&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ApolloProvider&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;root&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="c1"&gt;// If you want your app to work offline and load faster, you can change&lt;/span&gt;
&lt;span class="c1"&gt;// unregister() to register() below. Note this comes with some pitfalls.&lt;/span&gt;
&lt;span class="c1"&gt;// Learn more about service workers: https://bit.ly/CRA-PWA&lt;/span&gt;
&lt;span class="nx"&gt;serviceWorker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unregister&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;gql&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;JavaScript template literal tag that parses GraphQL queries into an abstract syntax tree (AST)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//queries.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;graphql-tag&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ALL_EMPLOYEES_LISTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
  query AllEmployeeLists {
    employees {
        name
        id
        role
        createdAt
        img
        employer
    }
  }
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;CREATE_EMPLOYEE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
  mutation createEmployee($newEmployee: NewEmployeeInput!) {
    addEmployee(input: $newEmployee) {
        name
        id
        role
        createdAt
        img
        employer
    }
  }
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;UPDATE_EMPLOYEE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
  mutation updateEmployeeData($updateEmployee: updatedEmployee!) {
    updateEmployee(input: $updateEmployee) {
        name
        id
        role
        createdAt
        img
        employer
    }
  }
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;DELETE_EMPLOYEE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gql&lt;/span&gt;&lt;span class="s2"&gt;`
  mutation deleteEmployeeData($deleteEmployee: EmployeesId!) {
    deleteEmployee(input: $deleteEmployee) {
        id
    }
  }
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;useQuery&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;useQuery&lt;/code&gt; React hook is the primary API for executing queries in an Apollo application. To run a query within a React component, call &lt;code&gt;useQuery&lt;/code&gt; and pass it a GraphQL query string. When your component renders, &lt;code&gt;useQuery&lt;/code&gt; returns an object from Apollo Client that contains &lt;code&gt;loading&lt;/code&gt;, &lt;code&gt;error&lt;/code&gt;, and &lt;code&gt;data&lt;/code&gt; properties you can use to render your UI.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useQuery&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@apollo/react-hooks&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ALL_EMPLOYEES_LISTS&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;useMutation&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;useMutation&lt;/code&gt; React hook is the primary API for executing mutations in an Apollo application. To run a mutation, you first call &lt;code&gt;useMutation&lt;/code&gt; within a React component and pass it a GraphQL string that represents the mutation. When your component renders, &lt;code&gt;useMutation&lt;/code&gt; returns a tuple that includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A mutate function that you can call at any time to execute the mutation&lt;/li&gt;
&lt;li&gt;An object with fields that represent the current status of the mutation's execution like &lt;code&gt;update&lt;/code&gt;, &lt;code&gt;variables&lt;/code&gt;, etc.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useMutation&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@apollo/react-hooks&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;deleteEmployeeData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;deleteReponse&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useMutation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;DELETE_EMPLOYEE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;update&lt;/code&gt; in useMutation
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;update&lt;/code&gt; function used to update the cache after a mutation occurs. Syntax as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;update(cache,mutationResult })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;readQuery&lt;/code&gt; &amp;amp; &lt;code&gt;writeQuery&lt;/code&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;readQuery&lt;/code&gt; method enables you to run GraphQL queries directly on your cache.&lt;/li&gt;
&lt;li&gt;If your cache contains all of the data necessary to fulfill a specified query, &lt;code&gt;readQuery&lt;/code&gt;returns a data object in the shape of your query, just like a GraphQL server does.&lt;/li&gt;
&lt;li&gt;If your cache doesn't contain all of the data necessary to fulfill a specified query, &lt;code&gt;readQuery&lt;/code&gt;throws an error. It never attempts to fetch data from a remote server.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;writeQuery&lt;/code&gt; - This method is used to write arbitrary data to the cache. If you reload your environment, these changes will disappear.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Below is the example of useMutation with update method&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;createEmployee&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useMutation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;CREATE_EMPLOYEE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="cm"&gt;/***Updating the local cache****/&lt;/span&gt;
    &lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;addEmployee&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readQuery&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ALL_EMPLOYEES_LISTS&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt; 
      &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeQuery&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ALL_EMPLOYEES_LISTS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// query to update&lt;/span&gt;
        &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;addEmployee&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;employees&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Basic optimistic UI using &lt;code&gt;optimisticResponse&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Let's say we have an "Add employee" mutation, and we want the UI to update immediately when the user submits the mutation, instead of waiting for the server response. &lt;br&gt;
The main way to get GraphQL data into your UI components with Apollo is to use a query, so if we want our optimistic response to update the UI, we have to make sure to return an optimistic response that will update the correct query result&lt;br&gt;
Here's what this looks like in the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/***Employee Create Methods ****/&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;onSubmit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;createEmployee&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;newEmployee&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;optimisticResponse&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;__typename&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Mutation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;createEmployee&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;__typename&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Employee&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// return type of mutation&lt;/span&gt;
          &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;createdAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
          &lt;span class="na"&gt;employer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;employer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;img&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://via.placeholder.com/300&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Feel free to comment if any doubt or any issue with the code.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Git board - A dashboard build using React in two days from scratch. </title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Mon, 20 Jan 2020 00:22:53 +0000</pubDate>
      <link>https://dev.to/karkranikhil/git-board-a-dashboard-build-using-react-in-two-days-from-scratch-cef</link>
      <guid>https://dev.to/karkranikhil/git-board-a-dashboard-build-using-react-in-two-days-from-scratch-cef</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I always want to build an application that has a dashboard. I decided to start building the dashboard using the GitHub API. I started the project called &lt;strong&gt;git-board&lt;/strong&gt; which is is a dashboard for the top 100 repositories based on GitHub Stars.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Design
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Home page&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3AvFzV2D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/o0buudn3om7yxcsn117o.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3AvFzV2D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/o0buudn3om7yxcsn117o.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dashboard&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o37szn6I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qy2rw112vae2elfyify8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o37szn6I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qy2rw112vae2elfyify8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technical approach
&lt;/h2&gt;

&lt;p&gt;1) Create the base app using create-react-app&lt;br&gt;
2) create two pages &lt;code&gt;home page&lt;/code&gt; and &lt;code&gt;dashboard page&lt;/code&gt;. The home page is the landing page that lists down the top 100 repositories. The dashboard page is the main page that shows the detailed view of the selected repository.&lt;br&gt;
3) First created a &lt;code&gt;Header&lt;/code&gt; component that is different based on the route as shown below &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F8bwpQMz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jn8op6nlqvrkrjtjanxf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F8bwpQMz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jn8op6nlqvrkrjtjanxf.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QWZccpDx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/oigeq68lzhrpktujcsgn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QWZccpDx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/oigeq68lzhrpktujcsgn.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Use the fetch API to fetch the data from the Github API &lt;br&gt;
4) In home page list down the top 100 repositories in card format with their logo, name, and description as shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cGfrfznt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/oyllxmsuqyyc9jfpa68e.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cGfrfznt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/oyllxmsuqyyc9jfpa68e.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5) Build a search box for filtering out the repository as shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oqoX3mZe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7i889anqwnajxxfrfvyu.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oqoX3mZe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7i889anqwnajxxfrfvyu.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6) on click of the card, we are navigating to the dashboard page and passing down the selected repo owner name and name.&lt;/p&gt;

&lt;p&gt;7) In the dashboard page, we have created the grid using the flexbox based on our design&lt;/p&gt;

&lt;p&gt;8) I have used the &lt;em&gt;canvasjs&lt;/em&gt; charting library for visualization. Based on the types of a chart I have to build a component like BarChart, &lt;code&gt;columnChart&lt;/code&gt; etc.&lt;/p&gt;

&lt;p&gt;9)In the dashboard page, I have used the multiple GitHub API using the &lt;code&gt;promise.all&lt;/code&gt;. Based on the data render the respective chart.&lt;/p&gt;

&lt;p&gt;10 The final output of the dashboard is similar to as shown below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o37szn6I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qy2rw112vae2elfyify8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o37szn6I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qy2rw112vae2elfyify8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo Video
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/FX7QsYFV5oY"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Resource
&lt;/h2&gt;

&lt;p&gt;If you like my work please give a star as an appreciation on my GitHub repository.&lt;/p&gt;

&lt;p&gt;Github - &lt;a href="https://github.com/karkranikhil/git-board"&gt;https://github.com/karkranikhil/git-board&lt;/a&gt;&lt;br&gt;
App URL - &lt;a href="https://git-board.karkranikhil.now.sh/"&gt;https://git-board.karkranikhil.now.sh/&lt;/a&gt;  &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>development</category>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>Multiple worksheets in excel using Lightning web component</title>
      <dc:creator>Nikhil karkra</dc:creator>
      <pubDate>Mon, 13 Jan 2020 13:24:28 +0000</pubDate>
      <link>https://dev.to/karkranikhil/multiple-worksheets-in-excel-using-lightning-web-components-4fpp</link>
      <guid>https://dev.to/karkranikhil/multiple-worksheets-in-excel-using-lightning-web-components-4fpp</guid>
      <description>&lt;p&gt;The original article is written on &lt;a href="https://salesforcelightningweb.com/#multiple-worksheets-in-excel-using-lwc"&gt;Salesforce Lightning Web&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Downloading the table data in Excel sheet is easy but downloading the multiple table data in multiple worksheets of Excel is quite challenging. To achieve this in LWC we need to follow the following steps&lt;/p&gt;

&lt;h2&gt;
  
  
  Download the xlsx.js
&lt;/h2&gt;

&lt;p&gt;I have done some modifications in the xlsx.js to make it compatible with salesforce lightning. So, use the following link and download&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.githubusercontent.com/karkranikhil/5d9db87139cac952c6b37a6828d855bc/raw/35b846a516456614830e284f05523f0696bc6845/xlsx.full.min.js"&gt;https://gist.githubusercontent.com/karkranikhil/5d9db87139cac952c6b37a6828d855bc/raw/35b846a516456614830e284f05523f0696bc6845/xlsx.full.min.js&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add the xlsx.js to static resources
&lt;/h2&gt;

&lt;p&gt;Create a folder with name &lt;code&gt;xlsx&lt;/code&gt; and put the filexlsx.full.min.js in it. Zip the folder and upload it to the Static resources as shown below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y7_bCa21--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/37i1mp8vrvfmi7moucg3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y7_bCa21--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/37i1mp8vrvfmi7moucg3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Create lightning web component - xlsxDemo
&lt;/h2&gt;

&lt;p&gt;Create a LWC with name xlsxDemo and add the following code to the &lt;strong&gt;xlsxDemo.js&lt;/strong&gt; file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the below code we have used the two apex methodgetContactLists &amp;amp;&amp;amp; getAccountLists to get the data from contact and account table respectively.&lt;/li&gt;
&lt;li&gt;Within the &lt;code&gt;connectedCallback&lt;/code&gt; lifecycle hook we have called the &lt;code&gt;getContactLists&lt;/code&gt; &amp;amp;&amp;amp; getAccountLists and using promise resolved them.&lt;/li&gt;
&lt;li&gt;We have stored the contact list headers in &lt;code&gt;this.contactHeader&lt;/code&gt; and data in &lt;code&gt;this.contactData&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Similarly, Store the account list headers in &lt;code&gt;this.accountHeader&lt;/code&gt; and data in &lt;code&gt;this.accountData&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Using this.xlsFormatter method to create the array of tables data and array of header. Also, using the &lt;code&gt;this.workSheetName&lt;/code&gt; List which contains the list of worksheet names.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!--&lt;/span&gt;&lt;span class="nx"&gt;xlsxDemo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;js&lt;/span&gt;&lt;span class="o"&gt;--&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LightningElement&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;track&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lwc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;getContactLists&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@salesforce/apex/ContactController.getContactLists&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;getAccountLists&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@salesforce/apex/AccountController.getAccountLists&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;XlsxDemo&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;LightningElement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;track&lt;/span&gt; &lt;span class="nx"&gt;xlsHeader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt; &lt;span class="c1"&gt;// store all the headers of the the tables&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;track&lt;/span&gt; &lt;span class="nx"&gt;workSheetNameList&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt; &lt;span class="c1"&gt;// store all the sheets name of the the tables&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;track&lt;/span&gt; &lt;span class="nx"&gt;xlsData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt; &lt;span class="c1"&gt;// store all tables data&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;track&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;nikhil_demo.xlsx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Name of the file&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;track&lt;/span&gt; &lt;span class="nx"&gt;accountData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt; &lt;span class="c1"&gt;// used only for storing account table&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;track&lt;/span&gt; &lt;span class="nx"&gt;contactData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt; &lt;span class="c1"&gt;// used only for storing contact table&lt;/span&gt;

  &lt;span class="nx"&gt;connectedCallback&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//apex call for bringing the contact data  &lt;/span&gt;
    &lt;span class="nx"&gt;getContactLists&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contactHeader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contactData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;contactData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xlsFormatter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Contacts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="c1"&gt;//apex call for bringing the account data  &lt;/span&gt;
    &lt;span class="nx"&gt;getAccountLists&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;accountHeader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;accountData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;accountData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xlsFormatter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Accounts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// formating the data to send as input to  xlsxMain component&lt;/span&gt;
  &lt;span class="nx"&gt;xlsFormatter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sheetName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;Header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xlsHeader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Header&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;workSheetNameList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sheetName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;xlsData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="c1"&gt;// calling the download function from xlsxMain.js &lt;/span&gt;
  &lt;span class="nx"&gt;download&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;c-xlsx-main&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;download&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Replace the following code in xlsxDemo.html file&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;code&gt;xlsxDemo.html&lt;/code&gt; we are calling the xlsxMain component. In c-xlsx-main component, we are passing the &lt;code&gt;xlsHeader&lt;/code&gt;, &lt;code&gt;filename&lt;/code&gt;, &lt;code&gt;workSheetNameList&lt;/code&gt; and &lt;code&gt;xlsData&lt;/code&gt; which is the header of the excel sheet, name of the excel sheet, worksheet names and excel sheet data respectively.&lt;/li&gt;
&lt;li&gt;Created a download button on click of which downloading of excel sheet will trigger&lt;/li&gt;
&lt;li&gt;Created the Account and Contact table using &lt;code&gt;for:each&lt;/code&gt; loop
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"margin-bottom-2rem"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;lightning-card&lt;/span&gt; &lt;span class="na"&gt;title=&lt;/span&gt;&lt;span class="s"&gt;"XLSX multi worksheet"&lt;/span&gt; &lt;span class="na"&gt;icon-name=&lt;/span&gt;&lt;span class="s"&gt;"custom:custom14"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"slds-m-around_medium"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;{download}&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"btn success"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Download&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
        &lt;span class="c"&gt;&amp;lt;!--xlsxMain component calling--&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;c-xlsx-main&lt;/span&gt;
          &lt;span class="na"&gt;header-list=&lt;/span&gt;&lt;span class="s"&gt;{xlsHeader}&lt;/span&gt;
          &lt;span class="na"&gt;filename=&lt;/span&gt;&lt;span class="s"&gt;{filename}&lt;/span&gt;
          &lt;span class="na"&gt;worksheet-name-list=&lt;/span&gt;&lt;span class="s"&gt;{workSheetNameList}&lt;/span&gt;
          &lt;span class="na"&gt;sheet-data=&lt;/span&gt;&lt;span class="s"&gt;{xlsData}&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;gt;&amp;lt;/c-xlsx-main&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="c"&gt;&amp;lt;!--Account Table--&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"child-container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Account Table&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
              &lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;for:each=&lt;/span&gt;&lt;span class="s"&gt;{accountHeader}&lt;/span&gt; &lt;span class="na"&gt;for:item=&lt;/span&gt;&lt;span class="s"&gt;"header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;{header}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{header}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
              &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;for:each=&lt;/span&gt;&lt;span class="s"&gt;{accountData}&lt;/span&gt; &lt;span class="na"&gt;for:item=&lt;/span&gt;&lt;span class="s"&gt;"item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="nt"&gt;&amp;lt;tr&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;{item.Id}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;{item.Id}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;{item.Name}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;{item.Phone}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;{item.NumberOfEmployees}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
              &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
        &lt;span class="c"&gt;&amp;lt;!--Contact Table--&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"child-container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Contact Table&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
              &lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;for:each=&lt;/span&gt;&lt;span class="s"&gt;{contactHeader}&lt;/span&gt; &lt;span class="na"&gt;for:item=&lt;/span&gt;&lt;span class="s"&gt;"header"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;{header}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{header}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
              &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;template&lt;/span&gt; &lt;span class="na"&gt;for:each=&lt;/span&gt;&lt;span class="s"&gt;{contactData}&lt;/span&gt; &lt;span class="na"&gt;for:item=&lt;/span&gt;&lt;span class="s"&gt;"item"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="nt"&gt;&amp;lt;tr&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;{item.Id}&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;{item.Name}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;{item.Phone}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;{item.Email}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;{item.Title}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;{item.Id}&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
              &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
          &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/lightning-card&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Replace the following code in &lt;em&gt;xlsxDemo.js-meta.xml&lt;/em&gt; file.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="xlsxDemo"&amp;gt;
    &amp;lt;apiVersion&amp;gt;46.0&amp;lt;/apiVersion&amp;gt;
    &amp;lt;isExposed&amp;gt;true&amp;lt;/isExposed&amp;gt;
    &amp;lt;targets&amp;gt;
        &amp;lt;target&amp;gt;lightning__AppPage&amp;lt;/target&amp;gt;
        &amp;lt;target&amp;gt;lightning__RecordPage&amp;lt;/target&amp;gt;
        &amp;lt;target&amp;gt;lightning__HomePage&amp;lt;/target&amp;gt;
    &amp;lt;/targets&amp;gt;
&amp;lt;/LightningComponentBundle&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Create lightning web component - &lt;em&gt;xlsxMain&lt;/em&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In this component we will write our logic for downloading the excel with multiple worksheet.&lt;/li&gt;
&lt;li&gt;In this component first will include the file &lt;code&gt;xlsx.full.min.js&lt;/code&gt; from the static resources
*We have used the &lt;code&gt;loadScript&lt;/code&gt; to upload the &lt;code&gt;xlsx.full.min.js&lt;/code&gt; to the component using the renderedCallback lifecycle hook.&lt;/li&gt;
&lt;li&gt;In this component, we need to replace &lt;code&gt;xlsxMain.js&lt;/code&gt; code with the following code rest all file remain as it is.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@api&lt;/code&gt; download method get called once the download button clicked on the screen.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//xlsxMain.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LightningElement&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;api&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lwc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;loadScript&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lightning/platformResourceLoader&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;workbook&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@salesforce/resourceUrl/xlsx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;XlsxMain&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;LightningElement&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;api&lt;/span&gt; &lt;span class="nx"&gt;headerList&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;api&lt;/span&gt; &lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;api&lt;/span&gt; &lt;span class="nx"&gt;worksheetNameList&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;api&lt;/span&gt; &lt;span class="nx"&gt;sheetData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;librariesLoaded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;renderedCallback&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;renderedCallback xlsx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;librariesLoaded&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;librariesLoaded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;loadScript&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;workbook&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/xlsx/xlsx.full.min.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;success&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;})&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;failure&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;api&lt;/span&gt; &lt;span class="nx"&gt;download&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;XLSX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;XLSX&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;xlsData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sheetData&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;xlsHeader&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headerList&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;ws_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;worksheetNameList&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;createXLSLFormatObj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;xlsData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;
    &lt;span class="c1"&gt;//let xlsRowsKeys = [];&lt;/span&gt;
    &lt;span class="cm"&gt;/* form header list */&lt;/span&gt;
      &lt;span class="nx"&gt;xlsHeader&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;createXLSLFormatObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="cm"&gt;/* form data key list */&lt;/span&gt;
      &lt;span class="nx"&gt;xlsData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;selectedRowIndex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;xlsRowKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
          &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;innerRowData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
              &lt;span class="nx"&gt;xlsRowKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
                  &lt;span class="nx"&gt;innerRowData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
              &lt;span class="p"&gt;})&lt;/span&gt;
              &lt;span class="nx"&gt;createXLSLFormatObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;selectedRowIndex&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;innerRowData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="p"&gt;})&lt;/span&gt;

      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="cm"&gt;/* creating new Excel */&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;wb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;XLSX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;book_new&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="cm"&gt;/* creating new worksheet */&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ws&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;createXLSLFormatObj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="cm"&gt;/* converting data to excel format and puhing to worksheet */&lt;/span&gt;
      &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;XLSX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aoa_to_sheet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;createXLSLFormatObj&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
      &lt;span class="nx"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

      &lt;span class="cm"&gt;/* Add worksheet to Excel */&lt;/span&gt;
      &lt;span class="nx"&gt;XLSX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;book_append_sheet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;wb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ws&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;ws_name&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cm"&gt;/* Write Excel and Download */&lt;/span&gt;
    &lt;span class="nx"&gt;XLSX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;wb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Run your code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Deploy both the component to your org.&lt;/li&gt;
&lt;li&gt;Edit your page where you want to show this component and it will take you to the app builder.&lt;/li&gt;
&lt;li&gt;drag the &lt;code&gt;xlsxDemo&lt;/code&gt; component listed under custom heading to the page and save it&lt;/li&gt;
&lt;li&gt;Go back to the page and you will see the following output
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lPiv786L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/2q56b3uvdl0rlpwxumkn.png" alt="Alt Text"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Download the excel sheet with multiple worksheets
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Once you click on the download button, excel sheet with name &lt;code&gt;nikhil_demo.xlsx&lt;/code&gt; get's download&lt;/li&gt;
&lt;li&gt;If you open the excel sheet you will see the following output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5hLbEu31--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jskpjfrxinerq37gfg3f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5hLbEu31--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jskpjfrxinerq37gfg3f.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Point 1 in the above image represents the file name&lt;/li&gt;
&lt;li&gt;Point 2 in the above image represents the worksheets name&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>lwc</category>
      <category>salesforce</category>
      <category>webcomponents</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
