<?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: Bhavesh Vaghela</title>
    <description>The latest articles on DEV Community by Bhavesh Vaghela (@vaghelabhavesh).</description>
    <link>https://dev.to/vaghelabhavesh</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%2F440746%2F88bd6be3-c604-4ca9-bdc8-6d2d606b09da.jpg</url>
      <title>DEV Community: Bhavesh Vaghela</title>
      <link>https://dev.to/vaghelabhavesh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vaghelabhavesh"/>
    <language>en</language>
    <item>
      <title>Some useful npm commands</title>
      <dc:creator>Bhavesh Vaghela</dc:creator>
      <pubDate>Sun, 22 Nov 2020 14:24:40 +0000</pubDate>
      <link>https://dev.to/vaghelabhavesh/some-useful-npm-commands-56h7</link>
      <guid>https://dev.to/vaghelabhavesh/some-useful-npm-commands-56h7</guid>
      <description>&lt;h3&gt;
  
  
  What is npm?
&lt;/h3&gt;

&lt;p&gt;npm is a package manager for the JavaScript programming language. It is the default package manager for &lt;a href="https://www.npmjs.com/"&gt;Node.js&lt;/a&gt;. Recently I completed a learning path &lt;a href="https://docs.microsoft.com/en-in/learn/paths/build-javascript-applications-nodejs/"&gt;Build JavaScript applications with Node.js&lt;/a&gt; and found some basic and useful npm commands which were very helpful to me, so I thought of sharing.&lt;/p&gt;

&lt;p&gt;Here are some useful npm commands.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To create a package.json in interactive mode, you can use the npm init command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm init&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To create a package.json in non interactive mode, use the npm init -y command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm init -y&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To get full detailed list of all the commands, type npm --help.&lt;/li&gt;
&lt;/ul&gt;


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

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm --help&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To install any package, you can use npm install command followed by package name.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm install &amp;lt;package name&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To install a package for development only which wont be shipped with production build, try the npm install with save-dev parameter. It also adds an entry in devDependencies in package.json.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm install &amp;lt;package name&amp;gt; --save-dev&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To install a package for production, try with production parameter. It adds an entry in dependencies in package.json.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm install &amp;lt;package name&amp;gt; --production&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To install a package in global directory instead of project's node_modules directory, use the g parameter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm install &amp;lt;package name&amp;gt; -g&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To take care of fetching the dependency and carrying out the command, and clean up so it is not saved (or do not take up space) in node_modules folder, try the following command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npx &amp;lt;name of package&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To list all the packages that your project is depending on, try the npm list command. It uses dependencies section from package.json. Use depth=0 for first level dependencies and depth=1 for 2nd level dependencies and so on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm list --depth=&amp;lt;depth&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To uninstall a package you use the uninstall command. It will remove the package from the manifest file and also from the node_modules directory.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm uninstall &amp;lt;name of dependency&amp;gt;&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To remove all dependencies in the node_modules directory that are not listed as dependencies in the manifest file, you can try the prune command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm prune&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To list all the outdated packages, use the outdated command&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm outdated&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To list vulnerabilities by different severity levels, high, and low for all the packages used in your project, use audit command&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm audit&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To fix the vulnerabilities found by audit, try the audit command with fix.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm audit fix&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To fix the vulnerabilities found by audit forcefully, try the force parameter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm audit fix --force&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To install the latest version, use @latest with npm install command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;npm install node-fetch@latest lodash@latest&lt;/code&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The following instruction will update to the latest patch version. If you only want the patch version to update, you would specify like this ~1.0.0. What this instruction says is equal or great to in the same range. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;~1.1.1 or 1.1.x&lt;/code&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The following instruction will update only the minor version. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;^1.1.1 or 1.x.1&lt;/code&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The following instruction will update to the highest major version. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;*1.1.1 or x.0.0&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The package-lock.json guarantees exact installs. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The following command starts debugger that comes bundled with Node.js. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;node inspect myscript.js&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrap up
&lt;/h3&gt;

&lt;p&gt;These were some basic and useful nom commands that can get you started with npm.&lt;/p&gt;

&lt;p&gt;Happy Coding.&lt;/p&gt;

&lt;h6&gt;
  
  
  This post was first posted on -  [&lt;a href="https://vaghelabhavesh.github.io/blog/2020/11/22/npm-commands.html%5D(https://vaghelabhavesh.github.io/blog/2020/11/22/npm-commands.html"&gt;https://vaghelabhavesh.github.io/blog/2020/11/22/npm-commands.html](https://vaghelabhavesh.github.io/blog/2020/11/22/npm-commands.html&lt;/a&gt;
&lt;/h6&gt;

</description>
    </item>
    <item>
      <title>Customizing Github Profile Page</title>
      <dc:creator>Bhavesh Vaghela</dc:creator>
      <pubDate>Fri, 31 Jul 2020 10:41:13 +0000</pubDate>
      <link>https://dev.to/vaghelabhavesh/customizing-github-profile-page-4jf8</link>
      <guid>https://dev.to/vaghelabhavesh/customizing-github-profile-page-4jf8</guid>
      <description>&lt;h3&gt;
  
  
  What is GitHub Profile Page?
&lt;/h3&gt;

&lt;p&gt;A github profile page like any other social media profile page  displays the user your public repositories and your contributions to all the repositories by day, month and year wise.  A person can also see who you are following on github and how many people are following you. Apart from this it also shows the repositories you have starred.  &lt;/p&gt;

&lt;p&gt;However till now it was not possible to customize this page since there was no customization available. But now it is possible to customize your github profile page by modifying a README.md in a username repo.&lt;/p&gt;

&lt;p&gt;So lets get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1: Create a repository&lt;/strong&gt;
Login into github and create a new repository with the same name as your github user name. Make sure to keep this repository public and initialize it with README.md file as shown in below screenshot.&lt;/li&gt;
&lt;/ul&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%2Fvaghelabhavesh.github.io%2F%2Fimages%2F2020-07-06%2F1.CreateRepo.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%2Fvaghelabhavesh.github.io%2F%2Fimages%2F2020-07-06%2F1.CreateRepo.png" alt="Create a repository"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 2: Edit README.md file&lt;/strong&gt;
Once the repository is created, open the README.md file and start editing it. You can add anything in this file - eg your twitter profile link, your linkedin profile link etc. You can also add your biography or description about your interest, hobbies, technologies you like etc as you can see in below screen shot.&lt;/li&gt;
&lt;/ul&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%2Fvaghelabhavesh.github.io%2F%2Fimages%2F2020-07-06%2F2.EditReadMe.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%2Fvaghelabhavesh.github.io%2F%2Fimages%2F2020-07-06%2F2.EditReadMe.png" alt="Edit README.md file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 3: Commit README.md file&lt;/strong&gt;
When you have completed making the change and you are ready, preview your changes and make sure to commit your changes.&lt;/li&gt;
&lt;/ul&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%2Fvaghelabhavesh.github.io%2F%2Fimages%2F2020-07-06%2F3.CommitReadMe.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%2Fvaghelabhavesh.github.io%2F%2Fimages%2F2020-07-06%2F3.CommitReadMe.png" alt="Commit README.md file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 4: Verify your changes on your Github Profile Page&lt;/strong&gt;
Next and final step is to go to your github profile page and verify that  your changes are showing up there.&lt;/li&gt;
&lt;/ul&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%2Fvaghelabhavesh.github.io%2F%2Fimages%2F2020-07-06%2F4.CheckProfile.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%2Fvaghelabhavesh.github.io%2F%2Fimages%2F2020-07-06%2F4.CheckProfile.png" alt="Verify your changes on your Github Profile Page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrap up
&lt;/h3&gt;

&lt;p&gt;Hopefully you learn something new today and like this post&lt;/p&gt;

&lt;p&gt;Happy Coding.&lt;/p&gt;

&lt;h6&gt;
  
  
  This post was first posted on -  [&lt;a href="https://vaghelabhavesh.github.io/blog/2020/07/06/customizing-github-profile-page.html(https://vaghelabhavesh.github.io/blog/2020/07/06/customizing-github-profile-page.html)" rel="noopener noreferrer"&gt;https://vaghelabhavesh.github.io/blog/2020/07/06/customizing-github-profile-page.html(https://vaghelabhavesh.github.io/blog/2020/07/06/customizing-github-profile-page.html)&lt;/a&gt;
&lt;/h6&gt;

</description>
      <category>github</category>
    </item>
    <item>
      <title>Winget (Preview) - Windows Package Manager</title>
      <dc:creator>Bhavesh Vaghela</dc:creator>
      <pubDate>Tue, 28 Jul 2020 05:55:25 +0000</pubDate>
      <link>https://dev.to/vaghelabhavesh/winget-preview-windows-package-manager-24nc</link>
      <guid>https://dev.to/vaghelabhavesh/winget-preview-windows-package-manager-24nc</guid>
      <description>&lt;h3&gt;
  
  
  What is Winget?
&lt;/h3&gt;

&lt;p&gt;Winget is a native windows package manager tool from Microsoft. It is &lt;a href="https://github.com/microsoft/winget-cli"&gt;open source&lt;/a&gt; and currently in preview as of 29th May, 2020.&lt;/p&gt;

&lt;p&gt;Winget will support &lt;strong&gt;Windows 10 Build 1707 and higher version&lt;/strong&gt;. If you are a windows insider (fast or slow ring) then you might already have winget installed. You can type winget -v in command prompt to confirm whether you have winget installed or not in your machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z5u1gn2z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://vaghelabhavesh.github.io/images/2020-05-29/winget1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z5u1gn2z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://vaghelabhavesh.github.io/images/2020-05-29/winget1.png" alt="Winget Version"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to use Winget?
&lt;/h3&gt;

&lt;p&gt;To install any package in winget, you have to type command - &lt;strong&gt;winget install package-name&lt;/strong&gt;. For example to install power toys, type in &lt;strong&gt;winget install powertoys&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KYBUtx7H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://vaghelabhavesh.github.io/images/2020-05-29/winget2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KYBUtx7H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://vaghelabhavesh.github.io/images/2020-05-29/winget2.png" alt="Winget Install"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What else Winget can do?
&lt;/h3&gt;

&lt;p&gt;The following commands are available:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;install&lt;/strong&gt; - Installs the given application
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;show&lt;/strong&gt; - Shows info about an application
&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;source&lt;/strong&gt; - Manage sources of applications&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;search&lt;/strong&gt; - Find and show basic info of apps&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;hash&lt;/strong&gt; - Helper to hash installer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;files&lt;/strong&gt; - validate  Validates a manifest file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oSz8UgDS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://vaghelabhavesh.github.io/images/2020-05-29/winget3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oSz8UgDS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://vaghelabhavesh.github.io/images/2020-05-29/winget3.png" alt="Winget Install"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example to see the information about powertoys which we installed, we can try command &lt;strong&gt;winget show powertoys&lt;/strong&gt; and it will display information such as version, description, publisher, homepage etc about powertoys.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cbCVqgIO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://vaghelabhavesh.github.io/images/2020-05-29/winget4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cbCVqgIO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://vaghelabhavesh.github.io/images/2020-05-29/winget4.png" alt="Winget Install"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Winget will help us in automating the process of getting application in our machine. You can specify application and it will install it on your machine. No hassle to search online, download and install. &lt;/p&gt;

&lt;p&gt;Happy Coding.&lt;/p&gt;

&lt;h6&gt;
  
  
  This post was first posted on -  &lt;a href="https://vaghelabhavesh.github.io/blog/2020/05/29/winget-windows-package-manager.html"&gt;https://vaghelabhavesh.github.io/blog/2020/05/29/winget-windows-package-manager.html&lt;/a&gt;
&lt;/h6&gt;

</description>
      <category>winget</category>
    </item>
  </channel>
</rss>
