<?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>Forem: Gulshan Saini</title>
    <description>The latest articles on Forem by Gulshan Saini (@gulshansaini).</description>
    <link>https://forem.com/gulshansaini</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%2F130631%2F0e63322a-ec32-474e-a464-bb356afc4b72.jpg</url>
      <title>Forem: Gulshan Saini</title>
      <link>https://forem.com/gulshansaini</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gulshansaini"/>
    <language>en</language>
    <item>
      <title>Why you should use TypeScript in 2021?</title>
      <dc:creator>Gulshan Saini</dc:creator>
      <pubDate>Mon, 22 Feb 2021 17:25:43 +0000</pubDate>
      <link>https://forem.com/gulshansaini/why-you-should-use-typescript-in-2021-56j</link>
      <guid>https://forem.com/gulshansaini/why-you-should-use-typescript-in-2021-56j</guid>
      <description>&lt;p&gt;Hey Guys, In this video I will try to convince you to use Typescript for your next projects or migrate existing projects. I am going to cover couple of scenarios where JavaScript miss common issue which are very obvious. &lt;/p&gt;

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

&lt;p&gt;I will show you how TypeScript can help in catching bugs early in development cycle and reduce complexity of application. TypeScript helps in not only catching code issues during compile time, it also helps in reducing the code.&lt;/p&gt;

&lt;p&gt;Typescript types are very powerful feature that can minimize issues in your code&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
    </item>
    <item>
      <title>I did #31Days31Videos challenge. Here’s what I learned.</title>
      <dc:creator>Gulshan Saini</dc:creator>
      <pubDate>Mon, 01 Feb 2021 11:35:34 +0000</pubDate>
      <link>https://forem.com/gulshansaini/i-did-31days31videos-challenge-here-s-what-i-learned-1fho</link>
      <guid>https://forem.com/gulshansaini/i-did-31days31videos-challenge-here-s-what-i-learned-1fho</guid>
      <description>&lt;p&gt;I started this year with a brand new &lt;a href="https://www.youtube.com/c/gulshansaini?sub_confirmation=1"&gt;Youtube channel&lt;/a&gt; on full-stack development. From 2015, I had a dream to start my Youtube channel, however, I was never serious about it. I kept delaying the things due to one or the other reason. It is not like I never took that step - I created few channels, posted some content however I was not consistent. Most of the channels I started, were not aligned with my daily work so, they never took off.&lt;/p&gt;

&lt;p&gt;If you are just interested in numbers, here are the stats from my Youtube channel&lt;/p&gt;

&lt;h3&gt;
  
  
  Total Videos 📈
&lt;/h3&gt;

&lt;p&gt;I managed to create 33 Videos in 31 days&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Video Uploads&lt;/strong&gt; : 30&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live streams&lt;/strong&gt; : 3&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total View&lt;/strong&gt; : 802&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch Time Hours&lt;/strong&gt; : 34.2 Hours&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subscribers&lt;/strong&gt; : 29&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Few reasons to delay
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Fear to face camera&lt;/li&gt;
&lt;li&gt;The camera and Mic on the PC is not of good quality&lt;/li&gt;
&lt;li&gt;Trying to create content on topics, I was not confident about&lt;/li&gt;
&lt;li&gt;Overthink about the content, script, and recording&lt;/li&gt;
&lt;li&gt;More focus on Youtube channel art, logo, thumbnails, etc&lt;/li&gt;
&lt;li&gt;Getting out of my comfort zone - I have a full-time job&lt;/li&gt;
&lt;li&gt;I can't spend more time with my Family&lt;/li&gt;
&lt;li&gt;English is not my native language and, people might not like it&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  To address some of the issues, I purchased
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;DSLR in 2017&lt;/li&gt;
&lt;li&gt;A phone with a nice camera in 2018 for b-roll&lt;/li&gt;
&lt;li&gt;WebCam and Mic in the year 2019&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even after purchasing all those gadgets, I was still standing in the same position. &lt;/p&gt;

&lt;h2&gt;
  
  
  Fast forward to 31 December 2020
&lt;/h2&gt;

&lt;p&gt;On the night of 31 Dec 2020 at 9:00 PM(approx), I asked myself, what I accomplished in the year 2020. I started a successful &lt;a href="https://tutorial.tips/"&gt;blog&lt;/a&gt; that is getting decent traffic. I fully utilised the corona pandemic time and wrote around 80+ posts in 8 months. But my dream of having a successful Youtube channel was still a dream.&lt;/p&gt;

&lt;p&gt;So that very moment, I decided to give it a serious thought. I created a plan on how the year 2021 should be. I gave myself a goal i.e. &lt;strong&gt;I want to be a content creator and helping other devs in the community&lt;/strong&gt;. There is nothing better than videos to share your knowledge with the community.&lt;/p&gt;

&lt;p&gt;I opened the excel file and came up with few topics/Youtube titles, I was comfortable with. So that I do not fail this time, I further split those topics into small topics that can be easily consumed by anyone. The idea was to focus on one topic at a time which allows the viewer to consume the content easily without getting distracted and overwhelmed. This was also good for me as a creator as I need not overthink about a topic and quickly get to the point while explaining.  Also, these types of focused videos will take less time to produce, edit and upload.&lt;/p&gt;

&lt;p&gt;This activity not only helped me in creating a concrete plan but also fixed other three reasons to delay, those were&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trying to create content on topics, I was not confident about&lt;/li&gt;
&lt;li&gt;Overthink about the content, script, and recording&lt;/li&gt;
&lt;li&gt;I can't spend more time with my Family&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, most of the issues were fixed and it was time to celebrate New Year in another 1 hour. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hold on hold on&lt;/em&gt;, few issues are still pending i.e. facing the camera, speaking while recording in a language that is not my native.&lt;/p&gt;

&lt;p&gt;To fix those issues, a crazy idea came to my mind. Let's build a &lt;a href="https://www.youtube.com/watch?v=rjT7kWdGpGE"&gt;New Year Countdown app&lt;/a&gt; in ReactJS and that too live on Youtube. I quickly jumped on Canva and created a thumbnail and scheduled a Livestream. I was very nervous as I never tried live stream in past. I downloaded OBS, pasted my live stream API key, and went live in a couple of minutes. There was pressure on my mind to finish the small web app in just 50 minutes. I forgot everything and opened VSCode and started coding. I am glad I was able to finish the application just before New Year.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;[shhhhh......secret - nobody came to watch while I was streaming 😂 ]&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I was really happy about my decision to go live as it allowed me to overcome my fear. During the process, I didn't even think about the camera or voice quality. I used all super powers of a developer(Google &amp;amp; Stackoverflow). My main focus was to finish the application within a limited time.&lt;/p&gt;

&lt;p&gt;Just after finishing the video, I decided to do the #31Days31Videos challenge. I already had a plan and list of topics that I would be covering in the next 31 days.&lt;/p&gt;

&lt;h3&gt;
  
  
  After posting continuously for 31 days
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I feel more comfortable in front of Mic&lt;/li&gt;
&lt;li&gt;I am not worried about the camera, mic, or language&lt;/li&gt;
&lt;li&gt;Getting better at recording and editing videos&lt;/li&gt;
&lt;li&gt;I am learning small things about the Youtube platform - you need not know everything before you start. You can make small improvements in each video.&lt;/li&gt;
&lt;li&gt;Youtube feels like part of my daily routine - there is no need to have a special time/isolated space/recording studio.&lt;/li&gt;
&lt;li&gt;I understood, to produce good quality you need to produce a good quantity. The more you create, the more you learn. The next video will always be better than the previous one. If you compare your first video with the latest one, you will always feel ashamed of it 😊 &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you came this far and want to be part of my Youtube journey, please &lt;a href="https://www.youtube.com/c/gulshansaini?sub_confirmation=1"&gt;subscribe to my channel&lt;/a&gt;. If you enjoyed the content, smash the like(👍 ) button, just below the video. Turn on the bell (🔔 ) notifications so you get the latest updates, whenever I post a new video.&lt;/p&gt;

&lt;p&gt;I hope this post helps and motivates you to accomplish your goals. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cheers!!!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>youtube</category>
      <category>31days31videos</category>
    </item>
    <item>
      <title>5 Command To Master Chrome Dev Tools</title>
      <dc:creator>Gulshan Saini</dc:creator>
      <pubDate>Mon, 18 Jan 2021 12:49:17 +0000</pubDate>
      <link>https://forem.com/gulshansaini/5-command-to-master-chrome-dev-tools-427l</link>
      <guid>https://forem.com/gulshansaini/5-command-to-master-chrome-dev-tools-427l</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/fiTr2hDeMBA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/c/gulshansaini?sub_confirmation=1"&gt;Subscribe On Youtube&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this video I am going to show you &lt;strong&gt;5&lt;/strong&gt; commands to master chrome dev tools&lt;/p&gt;

&lt;h2&gt;
  
  
  1 - Convert object to table
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;table({})&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;let&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;market&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Capital Market&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;marketStatus&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Close&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tradeDate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;11-Jan-2021&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;index&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;NIFTY 50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;last&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;14347.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;variation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;209.89999999999964&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;percentChange&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.48&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;marketStatusMessage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Market is Closed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;table&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="c1"&gt;// convert json to table&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2 - Print all keys for an object
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;keys({})&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;let&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;market&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Capital Market&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;marketStatus&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Close&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tradeDate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;11-Jan-2021&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;index&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;NIFTY 50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;last&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;14347.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;variation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;209.89999999999964&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;percentChange&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.48&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;marketStatusMessage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Market is Closed&lt;/span&gt;&lt;span class="dl"&gt;"&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="c1"&gt;// return keys of object&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3 - Clear the console
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;clear()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can clear the console by typing CMD+K on MAC or CTRL+K on windows&lt;br&gt;
Otherwise you can also call clear followed by round brackets and press return key&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;let&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;market&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Capital Market&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;marketStatus&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Close&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;tradeDate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;11-Jan-2021&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;index&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;NIFTY 50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;last&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;14347.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;variation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;209.89999999999964&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;percentChange&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.48&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;marketStatusMessage&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Market is Closed&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// clears console&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4 - Inspecting element
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt; &lt;code&gt;inspect(elementSelector)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can inspect element without touching mouse or touchpad using following command&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;// go to google.com&lt;/span&gt;
&lt;span class="c1"&gt;// open developer console and type&lt;/span&gt;
&lt;span class="nx"&gt;inspect&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="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="s1"&gt;input[name="q"]&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;
  
  
  5 - Show markup of recently selected element
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;$0&lt;/code&gt; returns the most recently selected element &lt;/p&gt;

&lt;h3&gt;
  
  
  BONUS TIP
&lt;/h3&gt;

&lt;p&gt;Similarly, $1 returns the second most recently selected one&lt;br&gt;
The &lt;code&gt;$0&lt;/code&gt;, &lt;code&gt;$1&lt;/code&gt;, &lt;code&gt;$2&lt;/code&gt;, &lt;code&gt;$3&lt;/code&gt; and &lt;code&gt;$4&lt;/code&gt; commands work as a historical reference to the last five DOM elements inspected within the Elements panel &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>chrome</category>
      <category>devtools</category>
      <category>html</category>
    </item>
    <item>
      <title>Opinion: Convert tutorial to video?</title>
      <dc:creator>Gulshan Saini</dc:creator>
      <pubDate>Fri, 18 Sep 2020 05:55:58 +0000</pubDate>
      <link>https://forem.com/gulshansaini/opinion-convert-tutorial-to-video-5c79</link>
      <guid>https://forem.com/gulshansaini/opinion-convert-tutorial-to-video-5c79</guid>
      <description>&lt;p&gt;I had a thought last night i.e. How to make dev.to post reach more audience.&lt;/p&gt;

&lt;p&gt;Their are some great post which covers&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;explaining hard stuff&lt;/li&gt;
&lt;li&gt;a new concept, package or library&lt;/li&gt;
&lt;li&gt;entire process of developing project&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;etc...&lt;/p&gt;

&lt;p&gt;So, I thought, Why not convert these posts to videos?&lt;/p&gt;

&lt;p&gt;In video, I can refer to the post and follow steps while we solve some problem. A credit(link back) to post in video description.&lt;/p&gt;

&lt;p&gt;What is your opinion? &lt;/p&gt;

&lt;p&gt;Queries&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Should I do that?&lt;/li&gt;
&lt;li&gt;Am I allowed to do that? What is license of posts done on dev.to&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>How to crop image in browser using JIMP?</title>
      <dc:creator>Gulshan Saini</dc:creator>
      <pubDate>Sun, 26 Jul 2020 15:09:18 +0000</pubDate>
      <link>https://forem.com/gulshansaini/how-to-crop-image-in-browser-using-jimp-2l22</link>
      <guid>https://forem.com/gulshansaini/how-to-crop-image-in-browser-using-jimp-2l22</guid>
      <description>&lt;p&gt;I had a situation where I had no backend server to handle the crop and resizing of an image. I know of a few cloud services which could do this easily however they come with a cost. So I thought to implement the solution within the browser itself. Before we proceed, let we warn you that this might not be an optimal solution for a page with a lot of images and which might require the use of web worker to offload the task to worker threads.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tutorial.tips/how-to-crop-image-in-browser-using-jimp"&gt;Read full article&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Output&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yZaS2zDk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bbsdg8puztuctabsh7dn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yZaS2zDk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bbsdg8puztuctabsh7dn.png" alt="Crop image vs original image JIMP output"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
      <category>javascript</category>
      <category>jimp</category>
    </item>
    <item>
      <title>How to disable prettier in VSCode for a specific project?</title>
      <dc:creator>Gulshan Saini</dc:creator>
      <pubDate>Fri, 19 Jun 2020 16:54:26 +0000</pubDate>
      <link>https://forem.com/gulshansaini/how-to-disable-prettier-in-vscode-for-a-specific-project-2a48</link>
      <guid>https://forem.com/gulshansaini/how-to-disable-prettier-in-vscode-for-a-specific-project-2a48</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://tutorial.tips/how-to-disable-prettier-in-vscode-for-specific-project" rel="noopener noreferrer"&gt;Post source&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Prettier is an opinionated code formatter and ensures that code follows consistent style. It can automatically fix formatting related issues for HTML, CSS and JavaScript - for complete list of supported languages, please look at the official &lt;a href="https://prettier.io/docs/en/index.html" rel="noopener noreferrer"&gt;docs&lt;/a&gt;. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you are working in a big team and want consistent code formatting without manual intervention(code reviews), I highly recommend Prettier. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Prettier is available as &lt;a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode" rel="noopener noreferrer"&gt;VSCode extension&lt;/a&gt; which can be enabled and it automatically take cares of formatting. You could even set preference when to format the file i.e. on file save or when you paste text etc.&lt;/p&gt;

&lt;p&gt;I love Prettier and use it daily for personal and organization projects. There could be a case where you do not want Prettier to automatically format files. &lt;/p&gt;

&lt;p&gt;Now the first option is to disable the VSCode extension. I am sure this is not what you are looking for as it is pain to enable and disable the extensions every time you switch projects.&lt;/p&gt;

&lt;p&gt;Other option is to enable Prettier only when a configuration file is present in the project. To enable this option open VSCode settings&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On Windows/Linux - File &amp;gt; Preferences &amp;gt; Settings&lt;/li&gt;
&lt;li&gt;On macOS - Code &amp;gt; Preferences &amp;gt; Settings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Search for &lt;strong&gt;Prettier:Require Config&lt;/strong&gt; and make sure it is checked&lt;/p&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%2Fqu9bg4vqlxw05m6vhi4w.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%2Fqu9bg4vqlxw05m6vhi4w.png" alt="Prettier:Require Config"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://bilkultaaza.com/5-reasons-to-choose-wellhealthorganic-vitamin-b12/" rel="noopener noreferrer"&gt;WellHealthOrganic Vitamin B12&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  So how does this work?
&lt;/h4&gt;

&lt;p&gt;By turning on this option, Prettier will only work for the projects having valid &lt;code&gt;.prettierrc&lt;/code&gt; file. A valid &lt;code&gt;.prettierrc&lt;/code&gt; could be as simple as having just opening and closing curly braces as follows&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="p"&gt;{}&lt;/span&gt;


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

&lt;/div&gt;

&lt;p&gt;Originally posted at &lt;a href="https://tutorial.tips/how-to-disable-prettier-in-vscode-for-specific-project" rel="noopener noreferrer"&gt;tutorial.tips&lt;/a&gt;&lt;/p&gt;

</description>
      <category>prettier</category>
      <category>vscode</category>
    </item>
    <item>
      <title>What is rel="noopener"?</title>
      <dc:creator>Gulshan Saini</dc:creator>
      <pubDate>Fri, 09 Aug 2019 02:14:12 +0000</pubDate>
      <link>https://forem.com/gulshansaini/what-is-rel-noopener-1214</link>
      <guid>https://forem.com/gulshansaini/what-is-rel-noopener-1214</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Original &lt;a href="https://tutorial.tips/what-is-rel-noopener/"&gt;Post&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In HTML, link types indicate the relationship between two documents, in which one links to the other using an &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;area&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt;, or &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; element.&lt;/p&gt;

&lt;p&gt;When you open another page using &lt;code&gt;target="_blank"&lt;/code&gt;, the other page may run on the same process as your page, unless Site Isolation is enabled. The other page can access your &lt;code&gt;window&lt;/code&gt; object with the &lt;code&gt;window.opener&lt;/code&gt; property. This allows other page to redirect your page to a malicious URL - see &lt;a href="https://mathiasbynens.github.io/rel-noopener/"&gt;About rel=noopener&lt;/a&gt; for more details. However, as mentioned by &lt;a href="https://twitter.com/jaffathecake"&gt;@Jake&lt;/a&gt; in his &lt;a href="https://jakearchibald.com/2016/performance-benefits-of-rel-noopener/"&gt;article&lt;/a&gt;, the origin security model of the web prevents other page from reading your page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;Include &lt;code&gt;rel="noopener"&lt;/code&gt; for all external links, generally when using &lt;code&gt;target="_blank"&lt;/code&gt;. The new window will run in separate process and it won't be able to access &lt;code&gt;window.opener&lt;/code&gt; property of parent page. You may also use &lt;code&gt;rel="noreferrer"&lt;/code&gt; which also prevents &lt;code&gt;Referer&lt;/code&gt; header being sent to new page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it yourself
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.google.com"&gt;Google&lt;/a&gt; - Neither &lt;code&gt;noopener&lt;/code&gt; nor &lt;code&gt;noreferrer&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.google.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Google&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a rel="noopener" href="https://www.google.com"&gt;Google&lt;/a&gt; - &lt;code&gt;rel="noopener"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"noopener"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.google.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Google&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a rel="noreferrer" href="https://www.google.com"&gt;Google&lt;/a&gt; - &lt;code&gt;rel="noreferrer"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"noreferrer"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.google.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Google&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Steps for verification&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click on link and go to new page/tab&lt;/li&gt;
&lt;li&gt;Open developer console and check value of &lt;code&gt;window.opener&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;While you are in developer console, go to network tab and reload the page to check &lt;code&gt;referer&lt;/code&gt; under &lt;code&gt;Request Headers&lt;/code&gt;(Chrome browser). For first &amp;amp; second, it should be &lt;code&gt;https://gulshansaini.dev/what-is-rel-noopener/&lt;/code&gt; whereas in third case, &lt;code&gt;referer&lt;/code&gt; property should not be present.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Is SEO impacted if we use noopener or noreferrer?
&lt;/h2&gt;

&lt;p&gt;Search engines do not consider noopener or noreferrer to rank pages. It is used to improve security of website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of noopener
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Improved security&lt;/li&gt;
&lt;li&gt;Improved performance - if new tab/page is running expensive JavaScript, it won't affect the referring page as it will not run on a separate process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Link to original post: &lt;a href="https://gulshansaini.dev/what-is-rel-noopener/"&gt;https://gulshansaini.dev/what-is-rel-noopener/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>html</category>
    </item>
    <item>
      <title>Automate NPM versioning</title>
      <dc:creator>Gulshan Saini</dc:creator>
      <pubDate>Thu, 28 Feb 2019 15:11:06 +0000</pubDate>
      <link>https://forem.com/gulshansaini/automate-npm-versioning-29k5</link>
      <guid>https://forem.com/gulshansaini/automate-npm-versioning-29k5</guid>
      <description>&lt;p&gt;If you are already using &lt;a href="https://docs.npmjs.com/cli/version.html" rel="noopener noreferrer"&gt;npm cli&lt;/a&gt; to manage package/product version, this article might not be for you.&lt;/p&gt;




&lt;p&gt;It may seem very obvious, to use npm cli to maintain package version(s) however in reality its totally different. I have seen projects where versioning is handled manually.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is version?
&lt;/h2&gt;

&lt;p&gt;When we release a package we need to version it. Versioning a release could also be swapped with term &lt;strong&gt;tagging&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;When we create a version, we are actually pointing a git commit id to human readable alphanumeric string. In below example we can see how &lt;code&gt;v16.8.3&lt;/code&gt; is linked to commit id &lt;code&gt;29b7b77&lt;/code&gt;&lt;/p&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgmuqogkaihicxp6991ih.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgmuqogkaihicxp6991ih.png" alt="React release"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is semantic version?
&lt;/h2&gt;

&lt;p&gt;A release could fall in any of below categories&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Major release&lt;/strong&gt;: Non backward compatible changes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Minor release&lt;/strong&gt;: Backward compatible with new feature&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Patch release&lt;/strong&gt;: Bug fix release with no new feature&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, if current package version is 1.0.0&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;patch release version would be 1.0.1&lt;/li&gt;
&lt;li&gt;minor release version would be 1.1.0&lt;/li&gt;
&lt;li&gt;and, major release version would be 2.0.0&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, you can manually update the version in package.json and create new tag on current commit id &lt;strong&gt;however&lt;/strong&gt; this is not what we want. We want some automation in this process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's, do it!!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Automate semantic version with npm cli?
&lt;/h2&gt;

&lt;p&gt;To demonstrate automation process, I am going to quickly create a new package and initialise repository on my local drive&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="nb"&gt;mkdir &lt;/span&gt;semver &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="nv"&gt;$_&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm init &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Next&lt;/strong&gt;, lets create a javascript file with single &lt;code&gt;console.log&lt;/code&gt; statement just to visualize changes in git log&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="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"console.log(&lt;/span&gt;&lt;span class="se"&gt;\`&lt;/span&gt;&lt;span class="s2"&gt;index file -&amp;gt; v1.0.0&lt;/span&gt;&lt;span class="se"&gt;\`&lt;/span&gt;&lt;span class="s2"&gt;)"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, lets commit changes to local repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -m "initial commit"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we open package.json we can see, right now the version is set to 1.0.0&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="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"name"&lt;/span&gt;: &lt;span class="s2"&gt;"semver"&lt;/span&gt;,
  &lt;span class="s2"&gt;"version"&lt;/span&gt;: &lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;,
   // skipped rest of lines
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Lets begin by creating patch release
&lt;/h3&gt;

&lt;p&gt;To make it more realistic lets change the &lt;code&gt;console.log&lt;/code&gt; statement to print  &lt;code&gt;index file -&amp;gt; v1.0.1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Open your favourite editor and make those changes - finally the contents of &lt;code&gt;index.js&lt;/code&gt; file should be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(`index file -&amp;gt; v1.0.1`)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, do not forget to commit you changes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -m "fixed issue with console statement"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create patch release we just need to type &lt;code&gt;npm version patch&lt;/code&gt; in terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm version patch
v1.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it - npm automatically updated the package.json and created new tag &lt;code&gt;v1.0.1&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;To verify, open package.json in editor and you should see new version&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "semver",
  "version": "1.0.1",
   // skipped rest of lines
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Similarly&lt;/strong&gt;, to verify if a new tag &lt;code&gt;v1.0.1&lt;/code&gt; was created we can type &lt;code&gt;git tag&lt;/code&gt; in terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag

//output
v1.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How cool was that!!!&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Now, lets create minor release
&lt;/h3&gt;

&lt;p&gt;Again, make some backward compatible changes in index.js and commit those changes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// contents of index.js after changes
console.log(`index file -&amp;gt; v1.1.0`)

// commit changes
git add .
git commit -m "updated minor version in logs"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make minor version we just modify last portion of command as follows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm version minor

//output
v1.1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cool!!! you can again verify the updated version in package.json and new tag that was created using &lt;code&gt;git tag&lt;/code&gt; command&lt;/p&gt;




&lt;h3&gt;
  
  
  Finally, lets create major release
&lt;/h3&gt;

&lt;p&gt;Lets replace contents of index.js with below contents and commit changes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// contents of index.js after changes
console.log(`Hello`, process.env.USER)

// commit changes
git add .
git commit -m "replaced console message with new one"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To bump the major version we update last command as follows&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm version major

// we should see below output
v2.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Finally, if we run &lt;code&gt;git tag&lt;/code&gt; command on terminal, we should see all tags that we created above&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag

// output
v1.0.1
v1.1.0
v2.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;You can type &lt;code&gt;npm version --help&lt;/code&gt; in terminal to see all available options or, read further on official page &lt;a href="https://docs.npmjs.com/cli/version.html" rel="noopener noreferrer"&gt;npm cli&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you liked this article!!&lt;/p&gt;

</description>
      <category>npm</category>
      <category>git</category>
      <category>node</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
