<?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: Muhammad</title>
    <description>The latest articles on DEV Community by Muhammad (@mbshehzad).</description>
    <link>https://dev.to/mbshehzad</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%2F1015002%2Fafe92f96-4167-4fcb-98c6-283b4930d7cc.PNG</url>
      <title>DEV Community: Muhammad</title>
      <link>https://dev.to/mbshehzad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mbshehzad"/>
    <language>en</language>
    <item>
      <title>What is the difference between git commit -m and git commit -am?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Tue, 02 Jul 2024 20:13:19 +0000</pubDate>
      <link>https://dev.to/mbshehzad/what-is-the-difference-between-git-commit-m-and-git-commit-am-1151</link>
      <guid>https://dev.to/mbshehzad/what-is-the-difference-between-git-commit-m-and-git-commit-am-1151</guid>
      <description>&lt;p&gt;With &lt;strong&gt;git commit -m&lt;/strong&gt; you only commit changes which are added using git add command.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;git commit -am&lt;/strong&gt; you commit ALL changed including those changes as well which are not added ussing git add&lt;/p&gt;

</description>
      <category>git</category>
      <category>node</category>
    </item>
    <item>
      <title>After merging a git branch to the main branch, how to delete it?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Fri, 21 Jun 2024 11:11:20 +0000</pubDate>
      <link>https://dev.to/mbshehzad/after-merging-a-git-branch-to-the-main-branch-how-to-delete-it-4p0b</link>
      <guid>https://dev.to/mbshehzad/after-merging-a-git-branch-to-the-main-branch-how-to-delete-it-4p0b</guid>
      <description>&lt;p&gt;You have to do 2 steps: you have to delete it locally as well as from your Github or whatever your remote respository is. Run the following 2 commands to do so:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;git branch -d [branchname]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git push origin --delete [branchname]&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>github</category>
      <category>node</category>
    </item>
    <item>
      <title>What mistakes do beginners do when they create Restful APIs?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Sat, 08 Jun 2024 11:00:44 +0000</pubDate>
      <link>https://dev.to/mbshehzad/what-mistakes-do-beginners-do-when-they-create-restful-apis-31kp</link>
      <guid>https://dev.to/mbshehzad/what-mistakes-do-beginners-do-when-they-create-restful-apis-31kp</guid>
      <description>&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Their APIs crash the server when an error occurs inside an API endpoint&lt;/strong&gt;. In a correctly made API, the server does not crash rather it continues running in case of an error inside an API endpoint. Do error handling by using &lt;strong&gt;.catch or try-catch&lt;/strong&gt; blocks.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>node</category>
    </item>
    <item>
      <title>What are the top-level steps to create an API ?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Sat, 08 Jun 2024 01:26:20 +0000</pubDate>
      <link>https://dev.to/mbshehzad/what-are-the-top-level-steps-to-create-an-api--53nc</link>
      <guid>https://dev.to/mbshehzad/what-are-the-top-level-steps-to-create-an-api--53nc</guid>
      <description>&lt;p&gt;Step #1. Create the (data) models&lt;br&gt;
Step #2. Create the Server&lt;br&gt;
Step #3. Create the Create API&lt;br&gt;
Step #4. Create the Read API&lt;br&gt;
Step #5. Create the Update API&lt;br&gt;
Step #6. Create the Delete API&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>express</category>
    </item>
    <item>
      <title>How to connect to a Postgres database using URI in a Node JS app?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Mon, 27 May 2024 18:22:01 +0000</pubDate>
      <link>https://dev.to/mbshehzad/how-to-connect-to-a-postgres-database-using-uri-in-a-node-js-app-28ej</link>
      <guid>https://dev.to/mbshehzad/how-to-connect-to-a-postgres-database-using-uri-in-a-node-js-app-28ej</guid>
      <description>&lt;p&gt;You establish the connection to a Postgres database using its URI by writing the following piece of code:-&lt;/p&gt;

&lt;p&gt;const connectionString = 'postgresql://dbuser:&lt;a href="mailto:secretpassword@database.server.com"&gt;secretpassword@database.server.com&lt;/a&gt;:3211/mydb'&lt;/p&gt;

&lt;p&gt;const pool = new Pool({&lt;br&gt;
  connectionString,&lt;br&gt;
})&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to send email from my Node JS app using my Gmail account?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Mon, 10 Jul 2023 11:26:14 +0000</pubDate>
      <link>https://dev.to/mbshehzad/how-to-send-email-from-my-node-js-app-using-my-gmail-account-je</link>
      <guid>https://dev.to/mbshehzad/how-to-send-email-from-my-node-js-app-using-my-gmail-account-je</guid>
      <description>&lt;p&gt;&lt;strong&gt;First&lt;/strong&gt;, 3 methods exist in 2023:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using the Less Secure App Option: (it was shutdown themselves by Google recently) &lt;em&gt;&lt;strong&gt;Not Recommended&lt;/strong&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Using App Passwords: In 2023, you can not use nodemailer with simple configuration since Google does not allow doing so and the smalll caveat of App passwords is not recommended either by me. Access it by clicking &lt;a href="https://myaccount.google.com/u/2/apppasswords"&gt;https://myaccount.google.com/u/2/apppasswords&lt;/a&gt; &lt;em&gt;&lt;strong&gt;Not Recommended&lt;/strong&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Using OAuth &lt;em&gt;&lt;strong&gt;Recommended&lt;/strong&gt;&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Secondly&lt;/strong&gt;, I will show the Google-recommended way of sending from you Node JS app an email using your Gmail account.&lt;/p&gt;

&lt;p&gt;Step 1. Create a project in Google Cloud console&lt;br&gt;
Step 2. Turn on Gmail API in "APIs and Services"&lt;br&gt;
Step 3. Configure the "OAuth Consent Screen"&lt;br&gt;
Step 4. &lt;/p&gt;

&lt;p&gt;(still writing)&lt;/p&gt;

</description>
      <category>gmail</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Does 'npm update' change the version numbers in the package.json file?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Sat, 24 Jun 2023 21:11:07 +0000</pubDate>
      <link>https://dev.to/mbshehzad/does-npm-update-change-the-version-numbers-in-the-packagejson-file-4hd2</link>
      <guid>https://dev.to/mbshehzad/does-npm-update-change-the-version-numbers-in-the-packagejson-file-4hd2</guid>
      <description>&lt;p&gt;&lt;em&gt;Short answer&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No&lt;/strong&gt;, &lt;code&gt;npm update&lt;/code&gt; &lt;strong&gt;does NOT change the version numbers in the package.json file to updated version numbers.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Long answer&lt;/em&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Running &lt;code&gt;npm update&lt;/code&gt;does not update the version numbers in the &lt;code&gt;package.json&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;However it does change the version numbers in the &lt;strong&gt;"node_modules/packagename"&lt;/strong&gt; field of the respective packages listed in the &lt;strong&gt;"packages"&lt;/strong&gt; key and the dependecies in the  &lt;strong&gt;"dependencies"&lt;/strong&gt; keys in the &lt;code&gt;package-lock.json&lt;/code&gt;file.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>npm</category>
      <category>node</category>
    </item>
    <item>
      <title>What is INLINE_RUNTIME_CHUNK environment vairable?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Wed, 10 May 2023 23:20:23 +0000</pubDate>
      <link>https://dev.to/mbshehzad/what-is-inlineruntimechunk-environment-vairable-19ea</link>
      <guid>https://dev.to/mbshehzad/what-is-inlineruntimechunk-environment-vairable-19ea</guid>
      <description>&lt;p&gt;When you run npm run build for a React app, this will prevent addition of inline JS into the build folder's index.html and create and attach separate JS files instead.&lt;/p&gt;

&lt;p&gt;To use this environment variable, edit the build command as follows:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;“build”: “INLINE_RUNTIME_CHUNK=false react-scripts build”,&lt;/code&gt;&lt;br&gt;
If you rebuild your project, the generated index.html will contain no reference to inline JavaScript code.&lt;/p&gt;

&lt;p&gt;Note:- For me I was getting error 'INLINE_RUNTIME_CHUNK' is not recognized as an internal or external command, operable program or batch file. when I added it directly in the script. I have to check the issue but I think in Windows, we cannot set env variable directly in a script and have to put it in a separate .env file.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Does React's npm run build add inline scripts in the build folder's index.html?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Wed, 10 May 2023 23:03:44 +0000</pubDate>
      <link>https://dev.to/mbshehzad/does-reacts-npm-run-build-add-inline-scripts-in-the-build-folders-indexhtml-16fa</link>
      <guid>https://dev.to/mbshehzad/does-reacts-npm-run-build-add-inline-scripts-in-the-build-folders-indexhtml-16fa</guid>
      <description>&lt;p&gt;&lt;strong&gt;No&lt;/strong&gt;, as of 11-May-2023, React does NOT add any inline scripts into the build folder's index.html file. &lt;/p&gt;

&lt;p&gt;The build folder's index.html file includes an external JS file instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;However in the previous versions before React 16 it did so&lt;/strong&gt;, and still some third-party dependencies might do so as well. But React itself does not anymore.&lt;/p&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>Does react build command automatically put all files inside public folder to inside build folder?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Tue, 09 May 2023 00:46:18 +0000</pubDate>
      <link>https://dev.to/mbshehzad/does-react-build-command-automatically-put-all-files-inside-public-folder-to-inside-build-folder-5876</link>
      <guid>https://dev.to/mbshehzad/does-react-build-command-automatically-put-all-files-inside-public-folder-to-inside-build-folder-5876</guid>
      <description>&lt;p&gt;&lt;strong&gt;Yes&lt;/strong&gt;, by default, when you run &lt;code&gt;npm run build&lt;/code&gt; , the create-react-app build process will copy all files in the public folder to the build folder when creating a production build. This includes any HTML files, images, or other static assets that are placed in the public folder.&lt;/p&gt;

</description>
      <category>react</category>
      <category>node</category>
      <category>webpack</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Which file is run if I just write nodemon and press enter to run it ?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Fri, 07 Apr 2023 02:21:59 +0000</pubDate>
      <link>https://dev.to/mbshehzad/which-file-is-run-if-i-just-write-nodemon-and-press-enter-to-run-it--5a8j</link>
      <guid>https://dev.to/mbshehzad/which-file-is-run-if-i-just-write-nodemon-and-press-enter-to-run-it--5a8j</guid>
      <description>&lt;p&gt;If you just type &lt;code&gt;nodemon&lt;/code&gt;in the terminal and press enter, the file which is mentioned in &lt;strong&gt;the &lt;code&gt;main&lt;/code&gt; key of the &lt;code&gt;package.json&lt;/code&gt; file&lt;/strong&gt; will run.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>heroku</category>
      <category>npm</category>
    </item>
    <item>
      <title>What is the best example to learn the ES6 spread operator (...) ?</title>
      <dc:creator>Muhammad</dc:creator>
      <pubDate>Tue, 21 Mar 2023 12:47:45 +0000</pubDate>
      <link>https://dev.to/mbshehzad/what-is-the-best-example-to-learn-about-the-es6-spread-operator--2aj8</link>
      <guid>https://dev.to/mbshehzad/what-is-the-best-example-to-learn-about-the-es6-spread-operator--2aj8</guid>
      <description>&lt;p&gt;The following example taken from &lt;strong&gt;MDN&lt;/strong&gt; is the best example I ever found to learn the spread operator as of 21 March 2023:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function sum(x, y, z) {
  return x + y + z;
}

const numbers = [1, 2, 3];

console.log(sum(...numbers));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>node</category>
      <category>react</category>
    </item>
  </channel>
</rss>
