<?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: Patrícia Pereira</title>
    <description>The latest articles on DEV Community by Patrícia Pereira (@patricepeartree).</description>
    <link>https://dev.to/patricepeartree</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%2F353143%2F98e062c6-1e31-4ca0-a2f4-6188ec0f2444.jpg</url>
      <title>DEV Community: Patrícia Pereira</title>
      <link>https://dev.to/patricepeartree</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/patricepeartree"/>
    <language>en</language>
    <item>
      <title>[Typper v1.0.0] Can you type your way to the top? 🎮🏆</title>
      <dc:creator>Patrícia Pereira</dc:creator>
      <pubDate>Mon, 11 Jan 2021 19:23:23 +0000</pubDate>
      <link>https://dev.to/patricepeartree/typper-v1-0-0-can-you-type-your-way-to-the-top-4674</link>
      <guid>https://dev.to/patricepeartree/typper-v1-0-0-can-you-type-your-way-to-the-top-4674</guid>
      <description>&lt;p&gt;After working on and releasing the core functionality of the game, it was time to focus on getting &lt;strong&gt;Typper&lt;/strong&gt; looking and feeling like a real game.&lt;/p&gt;

&lt;h3&gt;
  
  
  So, what's new?
&lt;/h3&gt;

&lt;p&gt;✨ Main menu and game over screens&lt;br&gt;
🏆 Game score and &lt;strong&gt;leaderboard&lt;/strong&gt; (&lt;em&gt;yes!&lt;/em&gt;)&lt;br&gt;
🌈 General UI improvements&lt;/p&gt;

&lt;p&gt;Give it a try, have fun and &lt;strong&gt;feel free to reach out&lt;/strong&gt; and give feedback 📝 or report a bug ⭕️.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://play-typper.web.app/" rel="noopener noreferrer"&gt;🎮 PLAY 🎮&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/patricepeartree" rel="noopener noreferrer"&gt;
        patricepeartree
      &lt;/a&gt; / &lt;a href="https://github.com/patricepeartree/typper-web" rel="noopener noreferrer"&gt;
        typper-web
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A simple typing game where our hero is a Ninja fighting off a never ending hoard of Zombies.
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;&lt;a href="https://twitter.com/PatricePeartree" rel="noopener noreferrer"&gt;PatricePeartree&lt;/a&gt; @ Twitter&lt;/em&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>gamedev</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Typper 💻🎮, (the beginning of) a typing game [v0.2.0-beta]</title>
      <dc:creator>Patrícia Pereira</dc:creator>
      <pubDate>Tue, 29 Sep 2020 13:36:23 +0000</pubDate>
      <link>https://dev.to/patricepeartree/typper-the-beginning-of-a-typing-game-v0-2-0-beta-17i9</link>
      <guid>https://dev.to/patricepeartree/typper-the-beginning-of-a-typing-game-v0-2-0-beta-17i9</guid>
      <description>&lt;p&gt;🎉 Introducing &lt;strong&gt;Typper&lt;/strong&gt;, a simple typing game where our hero is a Ninja fighting off a never ending hoard of Zombies. 🎉&lt;/p&gt;

&lt;p&gt;Typper is still in an early stage, there are many features and improvements to come that will make everything more interesting!&lt;/p&gt;

&lt;p&gt;Give it a try, have fun and &lt;strong&gt;feel free to reach out&lt;/strong&gt; and give feedback 📝 or report a bug ⭕️ (I am sure there are a few).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://play-typper.web.app/" rel="noopener noreferrer"&gt;🎮 PLAY 🎮&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/patricepeartree" rel="noopener noreferrer"&gt;
        patricepeartree
      &lt;/a&gt; / &lt;a href="https://github.com/patricepeartree/typper-web" rel="noopener noreferrer"&gt;
        typper-web
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A simple typing game where our hero is a Ninja fighting off a never ending hoard of Zombies.
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Remarks
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Typper is being developed using React. It is not the obvious approach to building a web-based game, but I wanted to familiarize myself with the new Hooks API, so 🙆.&lt;/li&gt;
&lt;li&gt;I did not use any library for the animations (sprites, object movement, collision detection, ...). I know it would have saved me a lot of work, but I wanted to try and use the Web Animations API.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://twitter.com/PatricePeartree" rel="noopener noreferrer"&gt;PatricePeartree&lt;/a&gt; @ Twitter&lt;/em&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>gamedev</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>COVID-19: Emergency Queue</title>
      <dc:creator>Patrícia Pereira</dc:creator>
      <pubDate>Fri, 01 May 2020 04:08:24 +0000</pubDate>
      <link>https://dev.to/patricepeartree/covid-19-emergency-queue-2b6h</link>
      <guid>https://dev.to/patricepeartree/covid-19-emergency-queue-2b6h</guid>
      <description>&lt;h2&gt;
  
  
  What we built
&lt;/h2&gt;

&lt;p&gt;In the midst of the COVID-19, myself and &lt;a class="comment-mentioned-user" href="https://dev.to/leeforaday"&gt;@leeforaday&lt;/a&gt;
 developed an application that we believe could &lt;strong&gt;simplify and improve the waiting process for someone who calls the Medical Emergency Line&lt;/strong&gt;. The application is intended to serve as a communication point between the medical responders of the national Medical Emergency Line and the callers (possible patients).&lt;/p&gt;

&lt;p&gt;While the ideia was thought with our country's particular situation in mind, it was implemented all in English and without any ties to any specific health line or entity.&lt;/p&gt;

&lt;p&gt;With our application in use, the process when someone calls the health line becomes the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The patient with symptoms calls the line;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It is greeted with an &lt;strong&gt;automatic response&lt;/strong&gt; that asks (and waits for the answer between each question):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the patient's name&lt;/li&gt;
&lt;li&gt;the patient's age&lt;/li&gt;
&lt;li&gt;a description of the patient's symptoms&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After answering these questions, a message is played informing the patient that they will &lt;strong&gt;receive an SMS with a request ID&lt;/strong&gt;, and more instructions on how to get information about their estimated waiting time;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The call finishes, and the patient receives the SMS with the request ID mentioned above, and a number to &lt;strong&gt;send a SMS to know the estimated waiting time&lt;/strong&gt; to receive a call back from one of the medical responders;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The medical responders have in their work interface two buttons, one to retrieve the next request in the queue, another to retrieve a welfare check request (patients that are already being continuously followed up by the medical team);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then they are presented with the information about the patient they are about to call (and in case of an welfare check, previous call notes that might have been written). &lt;strong&gt;From their desktop application, they can call back to the patient&lt;/strong&gt;. The responders can write notes about the call, and select the person for welfare checks if deemed necessary.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We also added some &lt;strong&gt;statistics&lt;/strong&gt; to the work interface of the medical responders: Calls in Queue, Calls in Progress, and Calls Processed Today. The daily statistics are reset every day at midnight.&lt;/p&gt;

&lt;h4&gt;
  
  
  Category Submission:
&lt;/h4&gt;

&lt;p&gt;COVID-19 Communications&lt;/p&gt;

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

&lt;p&gt;A patient starts by making a call to the Medical Emergency Line:&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/413806895" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;After the call is finished, the patient receives a text message:&lt;/p&gt;

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

&lt;p&gt;And they can then query for their estimated hold time:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oylAXcJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tmhy2fbme0panvksse0t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oylAXcJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tmhy2fbme0panvksse0t.jpg" alt="Estimated hold time"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Eventually, the patient request will be the next in the queue and a responder will process it:&lt;/p&gt;

&lt;h5&gt;
  
  
  Responder's desktop application view:
&lt;/h5&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/413806741" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h5&gt;
  
  
  Browser dialling from the responder to the patient (the responder selects the patient for daily welfare checks):
&lt;/h5&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/413806840" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;There can come a time when there are no more patients in the queue (not very likely):&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/413806805" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(The next day - since the patient was marked for daily welfare checks)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A responder processed the next patient in the welfare check queue:&lt;/p&gt;

&lt;h5&gt;
  
  
  Responder's desktop application view:
&lt;/h5&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/413806763" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h5&gt;
  
  
  Browser dialling from the responder to the patient:
&lt;/h5&gt;

&lt;p&gt;&lt;iframe src="https://player.vimeo.com/video/413807070" width="710" height="399"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;And that's it! All the patients are being taken care of and don't need to stay on hold on the phone waiting for an available medical responder! 🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Link to Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/patricepeartree/emergency-queue"&gt;https://github.com/patricepeartree/emergency-queue&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How we built it
&lt;/h2&gt;

&lt;p&gt;The implementation of this project integrated the following Twilio products:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.twilio.com/voice"&gt;Voice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.twilio.com/speech-recognition"&gt;Speech recognition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.twilio.com/sms"&gt;SMS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The desktop application was built with Electron and React (with redux and react-redux).&lt;/p&gt;

&lt;p&gt;The server was implemented in Node and Express. We also used &lt;a href="https://www.npmjs.com/package/agenda"&gt;agenda&lt;/a&gt;, a job scheduling library for Node.&lt;/p&gt;

&lt;p&gt;Real time communication between the server and the desktop application was implemented using &lt;a href="https://socket.io/"&gt;Socket.IO&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Typescript was used in both the server and the desktop application.&lt;/p&gt;

&lt;p&gt;The data is stored in a MongoDB database.&lt;/p&gt;

&lt;p&gt;And finally, Docker and Docker Compose to tie everything together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Resources/Info
&lt;/h2&gt;

&lt;p&gt;To help us make our server API publicly available from inside a Docker container, we used the &lt;a href="https://hub.docker.com/r/wernight/ngrok/"&gt;wernight/ngrok Docker image&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We added celebratory confetti when there are no requests left with the help of this great npm package: &lt;a href="https://www.npmjs.com/package/canvas-confetti"&gt;canvas-confetti&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The interface was designed mainly with components from &lt;a href="https://react.semantic-ui.com/"&gt;Semantic UI for React&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;A product of social distancing 🏠, created by:&lt;br&gt;
🍪 &lt;a class="comment-mentioned-user" href="https://dev.to/leeforaday"&gt;@leeforaday&lt;/a&gt;
&lt;br&gt;
☕ &lt;a class="comment-mentioned-user" href="https://dev.to/patricepeartree"&gt;@patricepeartree&lt;/a&gt;
&lt;/p&gt;


&lt;div class="ltag__user ltag__user__id__17020"&gt;
  
    .ltag__user__id__17020 .follow-action-button {
      background-color: #006c6c !important;
      color: #000000 !important;
      border-color: #006c6c !important;
    }
  
    &lt;a href="/leeforaday" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4jFJK_AB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--DUOLY_Tn--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/17020/e1ce0460-b61e-4f9b-a2a5-d45dd5c79bd1.jpeg" alt="leeforaday image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/leeforaday"&gt;Leonor Bandeira&lt;/a&gt;
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/leeforaday"&gt;big data, web dev, all the tv shows.&lt;/a&gt;
    &lt;/div&gt;
    &lt;p class="ltag__user__social"&gt;
        &lt;a href="https://twitter.com/leeforaday" rel="noopener"&gt;
          &lt;img class="icon-img" alt="twitter logo" src="https://res.cloudinary.com/practicaldev/image/fetch/s--oEHrSmvE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-logo.svg"&gt;leeforaday
        &lt;/a&gt;
    &lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>twiliohackathon</category>
      <category>react</category>
      <category>node</category>
      <category>electron</category>
    </item>
    <item>
      <title>COVID-19: Medical Emergency Line Queueing [Concept]</title>
      <dc:creator>Patrícia Pereira</dc:creator>
      <pubDate>Sun, 12 Apr 2020 13:05:25 +0000</pubDate>
      <link>https://dev.to/patricepeartree/covid-19-medical-emergency-line-queueing-concept-a3l</link>
      <guid>https://dev.to/patricepeartree/covid-19-medical-emergency-line-queueing-concept-a3l</guid>
      <description>&lt;p&gt;Hi, all.&lt;/p&gt;

&lt;p&gt;So me and &lt;a class="comment-mentioned-user" href="https://dev.to/leeforaday"&gt;@leeforaday&lt;/a&gt;
 have decided to participate in the &lt;em&gt;Twilio x DEV Hackaton&lt;/em&gt;, and here we are just putting our application idea out into the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small background
&lt;/h2&gt;

&lt;p&gt;Just like in many other countries, in our country, Portugal, the COVID-19 pandemic is hitting hard. Our National Health System, which is not at 100% even in normal situations, does not have conditions to receive and treat the enormous amount of patients needing medical care due to the COVID-19 virus.&lt;/p&gt;

&lt;p&gt;Our government and health authorities are working around this disability by trying to enforce people to &lt;strong&gt;first go through our existing national Medical Emergency Line&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If someone feels sick and suspects it might be from COVID-19 infection, instead of going to an hospital urgency service, they first must call this line. The patient will only go to the hospital if the medical responder deems that the their symptoms are serious enough to need medical assistance. If not, the patient will isolate themselves at home and be accompanied daily by phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;This approach is starting to show its first positive impacts by avoiding the collapse of the health system. But with the increasing number of calls to the Medical Emergency Line, the &lt;strong&gt;hold time has become proportionally bigger&lt;/strong&gt;, all the while with the callers obliged to stay on the call.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our solution
&lt;/h2&gt;

&lt;p&gt;Our proposal for this hackaton is to develop an application to &lt;strong&gt;simplify and improve the waiting process&lt;/strong&gt; for the patients who call this line. The application would be intended to be used by the medical responderes in the national Emergency Medical Line.&lt;/p&gt;

&lt;p&gt;The core feature of our application (&lt;em&gt;still to be named&lt;/em&gt;) is an &lt;strong&gt;idle waiting line&lt;/strong&gt; for the national Emergency Medical Line. The process would become the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The patient with symptoms would call the line.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There would be no human interaction at this point.&lt;/li&gt;
&lt;li&gt;They would be asked to identify themselves and describe their symptoms.&lt;/li&gt;
&lt;li&gt;The call would end and the patient would now be in a waiting line to be contacted back, but without the need to be on the phone.&lt;/li&gt;
&lt;li&gt;The patient would receive a request identifier by SMS which they can use at any time to get their estimated waiting time left.&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;The patient would eventually be contacted back by a medical responder. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After the call, if the medical responder decided that the patient is a COVID-19 suspect but without the need of medical assistance, they would be able to flag the patient for continuous phone follow ups.&lt;/li&gt;
&lt;/ul&gt;


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

&lt;h4&gt;
  
  
  Twilio Integration
&lt;/h4&gt;

&lt;p&gt;The implementation of this project will use the following Twilio products:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.twilio.com/voice"&gt;Voice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.twilio.com/speech-recognition"&gt;Speech recognition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.twilio.com/sms"&gt;SMS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;That's all for now. It's time to get to work and see what we can come up with until the end of the hackaton. Stay tunned!&lt;/p&gt;

</description>
      <category>twiliohackathon</category>
    </item>
    <item>
      <title>How to run multiple Node and Angular versions simultaneously</title>
      <dc:creator>Patrícia Pereira</dc:creator>
      <pubDate>Fri, 20 Mar 2020 18:01:34 +0000</pubDate>
      <link>https://dev.to/patricepeartree/how-to-run-multiple-node-and-angular-versions-simultaneously-3lfj</link>
      <guid>https://dev.to/patricepeartree/how-to-run-multiple-node-and-angular-versions-simultaneously-3lfj</guid>
      <description>&lt;p&gt;In my line of work as a Web Engineer, I have leaped through a decent amount of projects in a not so big amount of time. Not only that, but all of these projects had at least one &lt;a href="https://nodejs.org/"&gt;Node&lt;/a&gt; based component and a big part of them also used &lt;a href="https://angular.io/"&gt;Angular&lt;/a&gt; as their Frontend framework. So I eventually came to a point where I needed to actively work on my current project but be able to quickly switch back to any of the other projects.&lt;/p&gt;

&lt;p&gt;I must admit that the first time this switch was needed, I naively downgraded both Node and &lt;a href="https://cli.angular.io/"&gt;Angular CLI&lt;/a&gt;… Only to then upgrade them again when I went back to working on my current project. Not only is this a time-wasting process, it is susceptible to errors from missing information. An Angular project's CLI version is in the &lt;code&gt;package.json&lt;/code&gt; file, but what about the Node version? That is a piece of information that must be documented, and as we all know well, documentation is almost always left behind.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Each Angular version is compatible with a range of Node versions&lt;/strong&gt;. When downgrading/upgrading Angular CLI, you also need to make sure the Node version being used is compatible. Besides, it's good practice to maintain versions during development, unless explicitly wanting to change them.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It was in that moment that I started to search for a possible &lt;strong&gt;solution to manage different Node and Angular versions&lt;/strong&gt; for different projects. I found two concepts that seemed promising to be used together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/nvm-sh/nvm"&gt;nvm&lt;/a&gt;, a version manager for Node&lt;/li&gt;
&lt;li&gt;Local Angular CLI&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  nvm
&lt;/h1&gt;

&lt;p&gt;nvm is a Node version manager command line tool. It allows the user to install multiple Node versions on its machine and then use different versions in separate shells simultaneously.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;If you are not familiar with nvm commands, keep in mind that:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;nvm run [arguments]&lt;/code&gt; &lt;em&gt;is equivalent to&lt;/em&gt; &lt;code&gt;node [arguments]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nvm exec [command] [arguments]&lt;/code&gt; &lt;em&gt;is equivalent to&lt;/em&gt; &lt;code&gt;[command] [arguments]&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;A normal nvm usage workflow (and the one we are going to use to manage different projects' Node versions) would be to &lt;strong&gt;install each project's Node version and then execute it in an independent project dedicated shell&lt;/strong&gt;. Node can either be or not be natively installed in the machine, it does not make a difference for this use case.&lt;/p&gt;

&lt;p&gt;For demonstration purposes, let's suppose we have the following projects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project XPTO, Node version 8.17.0&lt;/li&gt;
&lt;li&gt;Project EPIC, Node version 12.16.1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To be able to execute both projects without needing to downgrade/upgrade your Node version, you have to:&lt;/p&gt;




&lt;h5&gt;
  
  
  1. Install both Node versions using nvm:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;nvm &lt;span class="nb"&gt;install &lt;/span&gt;8.17.0
&lt;span class="nv"&gt;$ &lt;/span&gt;nvm &lt;span class="nb"&gt;install &lt;/span&gt;12.16.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  2. Go to the directory of project XPTO and set nvm to use the correct Node version:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;nvm use 8.17.0
&lt;span class="c"&gt;# check Node version being used&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;nvm run &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="c"&gt;# or just "node -v"&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; Running node v8.17.0
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; v8.17.0
&lt;span class="c"&gt;# start project XPTO&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;nvm &lt;span class="nb"&gt;exec &lt;/span&gt;npm start &lt;span class="c"&gt;# or just "npm start"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;By executing&lt;/em&gt; &lt;code&gt;nvm use&lt;/code&gt; &lt;em&gt;you are defining the Node version that nvm is going to run in that shell, not only in the directory where you executed the command.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h5&gt;
  
  
  3. Open a new shell, go to the directory of project EPIC and do the same for that project's Node version.
&lt;/h5&gt;




&lt;p&gt;Now there are two different projects being executed by two different Node versions! &lt;em&gt;What's missing?&lt;/em&gt; Well, &lt;code&gt;nvm use&lt;/code&gt; action is &lt;strong&gt;shell session scoped&lt;/strong&gt;, which means new shells will start with the default nvm version of Node. So when you come back to work tomorrow and open a shell to start either of your projects, nvm will no longer be pointing to their correct Node version.&lt;/p&gt;

&lt;p&gt;Luckily, nvm has the &lt;a href="https://github.com/nvm-sh/nvm#nvmrc"&gt;&lt;code&gt;.nvmrc&lt;/code&gt;&lt;/a&gt; file, which allows the user to specify a &lt;strong&gt;Node version to be used by nvm in a directory&lt;/strong&gt; and all its sub-directories. Create this file in the root directory of your projects with the correct Node version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# in project root directory&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"8.17.0"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; .nvmrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure you always use nvm commands to execute Node or npm, given that these are the commands that search for and use the &lt;code&gt;.nvmrc&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# "node server.js" with Node version from .nvmrc&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;nvm run server.js
&lt;span class="c"&gt;# "npm start" with Node version from .nvmrc&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;nvm &lt;span class="nb"&gt;exec &lt;/span&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now nvm will always run the correct Node version for your projects!&lt;/p&gt;

&lt;h1&gt;
  
  
  Local Angular CLI
&lt;/h1&gt;

&lt;p&gt;If you are working on an Angular project, besides guaranteeing the correct Node version you also need to make sure you are using the correct Angular CLI version when running your &lt;code&gt;ng&lt;/code&gt; commands.&lt;/p&gt;

&lt;p&gt;When you create an Angular project, the &lt;strong&gt;Angular CLI is added as a development dependency&lt;/strong&gt; to your project's &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"devDependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@angular/cli"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"9.0.5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means that independently of the Angular CLI version you have globally installed in your machine, there will be a &lt;strong&gt;locally-installed Angular CLI in &lt;code&gt;node_modules&lt;/code&gt;&lt;/strong&gt; folder after installing your projects' dependencies. What you need to do is make sure you execute this locally-installed version instead of the global one. You can do one of the following:&lt;/p&gt;




&lt;h5&gt;
  
  
  Use &lt;code&gt;package.json&lt;/code&gt; scripts
&lt;/h5&gt;

&lt;p&gt;The &lt;code&gt;npm run-script&lt;/code&gt; command adds the &lt;code&gt;node_modules/.bin&lt;/code&gt; binaries to the pre-existing shell's PATH that is then provided to the scripts. This means that scripts in &lt;code&gt;package.json&lt;/code&gt; which execute &lt;code&gt;ng&lt;/code&gt; will be running the locally-installed Angular CLI. If you also want to directly execute &lt;code&gt;ng&lt;/code&gt; in the shell using this approach, you can add &lt;code&gt;"ng": "ng"&lt;/code&gt; as a script in &lt;code&gt;package.json&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ng"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ng"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ng serve"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# serve your application with nvm and local Angular CLI&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;nvm &lt;span class="nb"&gt;exec &lt;/span&gt;npm start
&lt;span class="c"&gt;# create an Angular component using local Angular CLI&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;nvm &lt;span class="nb"&gt;exec &lt;/span&gt;npm run ng g component my-cool-component
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h5&gt;
  
  
  Use &lt;code&gt;node_modules/.bin/ng&lt;/code&gt;
&lt;/h5&gt;

&lt;p&gt;Run the local Angular CLI by directly executing the binaries present in the &lt;code&gt;node_modules/.bin&lt;/code&gt; folder in a shell.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# create an Angular component using local Angular CLI&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;nvm &lt;span class="nb"&gt;exec&lt;/span&gt; ./node_modules/.bin/ng g component my-cool-component
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;By taking advantage of both &lt;strong&gt;nvm and local Angular CLI binaries&lt;/strong&gt;, it is not only possible to manage different Node and Angular versioned projects, but also to do it in a simple and straightforward way.&lt;/p&gt;

&lt;p&gt;With this methodology, it's important to &lt;strong&gt;never forget to use the nvm commands&lt;/strong&gt;! It's true that a simple command (e.g. to start a project) turns a bit more verbose, but the trade-off of being able to work on and execute multiple projects seamlessly is a big plus.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hope this is helpful for someone out there!&lt;/em&gt; 💡&lt;br&gt;
&lt;em&gt;And of course, thanks for reading.&lt;/em&gt; 🤓&lt;br&gt;
&lt;em&gt;If you have any question/suggestion/feedback, feel free to leave a comment.&lt;/em&gt; 📝&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://twitter.com/PatricePeartree"&gt;PatricePeartree&lt;/a&gt; @ Twitter&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>node</category>
      <category>angular</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
