<?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: Bos Eriko Reyes</title>
    <description>The latest articles on DEV Community by Bos Eriko Reyes (@boseriko).</description>
    <link>https://dev.to/boseriko</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%2F69471%2Fe526a538-e6a0-44c6-928a-632a1768f14e.png</url>
      <title>DEV Community: Bos Eriko Reyes</title>
      <link>https://dev.to/boseriko</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/boseriko"/>
    <language>en</language>
    <item>
      <title>How I'm avoiding using NPM in favor of Yarn</title>
      <dc:creator>Bos Eriko Reyes</dc:creator>
      <pubDate>Sat, 28 Sep 2019 08:03:59 +0000</pubDate>
      <link>https://dev.to/boseriko/how-i-m-avoiding-using-npm-in-favor-of-yarn-4cf6</link>
      <guid>https://dev.to/boseriko/how-i-m-avoiding-using-npm-in-favor-of-yarn-4cf6</guid>
      <description>&lt;p&gt;There are multiple, if not, hundreds of articles telling developers not to use NPM and instead use Yarn. I'm not going to go into details because that's not the point of this article but if you really want to know why I suggest doing a quick search. The articles that you will find will probably do more justice in explaining compared to how I will probably explain it.&lt;/p&gt;

&lt;p&gt;Anyway, it's easy to read articles but it's really not easy to apply what you just learned to your workflow. We need to consider how many times a developer might have typed &lt;code&gt;npm install&lt;/code&gt; in their life so no matter how hard someone tries to change there will probably be a little slip up here and there. At least that's the case for me.&lt;/p&gt;

&lt;p&gt;A trick that saved me from that is by using aliases. My shell is &lt;strong&gt;zsh&lt;/strong&gt; but even &lt;strong&gt;bash&lt;/strong&gt; can have aliases. Here's how the alias looks like.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias npm="echo 'Do you really want to use NPM instead of Yarn? \
           (Ctrl-C to abort, or press enter to continue)' &amp;amp;&amp;amp; \
           read &amp;amp;&amp;amp; npm"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What the snippet does is it just echoes a message asking if I really want to use NPM or if I can just use Yarn. At first, I was thinking of just adding &lt;code&gt;npm&lt;/code&gt; as the alias of &lt;code&gt;yarn&lt;/code&gt; but there are cases where something like that would probably be a bad idea. So this was the best I could come up with. If you want to use it as well just open up your shell's rc file. It can either be on &lt;code&gt;~/.bashrc&lt;/code&gt; or &lt;code&gt;~/.zshrc&lt;/code&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Here's how it looks like in action.
&lt;/h5&gt;

&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgktdm8gb1fsp80np6j6i.gif" 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%2Fgktdm8gb1fsp80np6j6i.gif" alt="In action!" width="600" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not much but I think it's pretty cool. With this I still have the option to use NPM but I will receive a warning every time I do it. Hope this helps even one of you!&lt;/p&gt;

</description>
      <category>npm</category>
      <category>yarn</category>
      <category>cli</category>
      <category>terminal</category>
    </item>
  </channel>
</rss>
