<?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: Suhail Akhtar</title>
    <description>The latest articles on DEV Community by Suhail Akhtar (@sambhal).</description>
    <link>https://dev.to/sambhal</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%2F151802%2F18426a78-c6b0-4703-af49-2d33036cfc79.jpeg</url>
      <title>DEV Community: Suhail Akhtar</title>
      <link>https://dev.to/sambhal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sambhal"/>
    <language>en</language>
    <item>
      <title>Introducing VCF Splitter: Online VCF Splitter Tool</title>
      <dc:creator>Suhail Akhtar</dc:creator>
      <pubDate>Tue, 05 Mar 2024 05:19:10 +0000</pubDate>
      <link>https://dev.to/sambhal/introducing-vcf-splitter-online-vcf-splitter-tool-46dp</link>
      <guid>https://dev.to/sambhal/introducing-vcf-splitter-online-vcf-splitter-tool-46dp</guid>
      <description>&lt;p&gt;🚀 Introducing VCF Splitter: Solution for Effortless Contact Management! 🚀&lt;br&gt;
I'm thrilled to present VCF Splitter, a helpful tool crafted with care for my friend who juggles a whopping 50,000 contacts! 🎉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvuc1gtsahva3v654ompz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvuc1gtsahva3v654ompz.png" alt="Image description" width="800" height="856"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is VCF?&lt;br&gt;
VCF, short for vCard File, is the go-to format for digital business cards, holding essential details like names, numbers, and emails.&lt;/p&gt;

&lt;p&gt;Features Tailored for You:&lt;br&gt;
✅ Local Splitting: Ensure data security by splitting VCF files directly on your device.&lt;br&gt;
✅ Custom Chunk Size: Personalize the split size to suit your contact management needs.&lt;br&gt;
✅ Download Options: Effortlessly download individual splits or gather them all in a ZIP file.&lt;/p&gt;

&lt;p&gt;How It Works:&lt;br&gt;
Upload: Select your VCF file.&lt;br&gt;
Customize: Choose your preferred chunk size.&lt;br&gt;
Split: Click "Split VCF" to get neatly organized contact files.&lt;/p&gt;

&lt;p&gt;This project was born out of the desire to simplify contact management for my friend and anyone else dealing with massive contact lists.&lt;/p&gt;

&lt;p&gt;Explore VCF Splitter here.&lt;br&gt;
Link1: &lt;a href="https://online-vcf-splitter.pages.dev"&gt;https://online-vcf-splitter.pages.dev&lt;/a&gt;&lt;br&gt;
Link2: &lt;a href="https://online-vcf-splitter.netlify.app"&gt;https://online-vcf-splitter.netlify.app&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Nodejs Fix Error connect ECONNREFUSED ::1:80 while using localhost</title>
      <dc:creator>Suhail Akhtar</dc:creator>
      <pubDate>Sat, 16 Dec 2023 16:18:24 +0000</pubDate>
      <link>https://dev.to/sambhal/nodejs-fix-error-connect-econnrefused-180-while-using-localhost-3co5</link>
      <guid>https://dev.to/sambhal/nodejs-fix-error-connect-econnrefused-180-while-using-localhost-3co5</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Node.js serves as a powerful platform for building server-side applications, but encountering errors, especially during local development, can disrupt progress. One such error is &lt;code&gt;connect ECONNREFUSED ::1:80&lt;/code&gt;, commonly faced while attempting to connect to a local server.&lt;/p&gt;

&lt;h1&gt;
  
  
  Understanding the Error
&lt;/h1&gt;

&lt;p&gt;The error message &lt;code&gt;connect ECONNREFUSED ::1:80&lt;/code&gt; signifies that the Node.js application is attempting to connect to the IPv6 loopback address (::1) on port 80, commonly used for HTTP traffic. However, the connection is being refused, leading to the error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const axios = require("axios")try { const { data } = await axios.get('http://localhost')} catch (error) { console.log(error.message) // output: "connect ECONNREFUSED ::1:80"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Solution 1
&lt;/h1&gt;

&lt;p&gt;You can fix the &lt;code&gt;connect ECONNREFUSED ::1:80&lt;/code&gt; error by explicitly specifying the IPv4 loopback address (127.0.0.1) instead of relying on the IPv6 (::1) address.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const axios = require("axios")try { const { data } = await axios.get('http://127.0.0.1') // Success Response} catch (error) { console.log(error.message)}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Solution 2
&lt;/h1&gt;

&lt;p&gt;Starting from Node.js 17 IPv6 connections are prioritized when making network calls. This is great for future-proofing your code, but it can cause problems if the server you're trying to reach only supports IPv4. This is where &lt;code&gt;setDefaultResultOrder()&lt;/code&gt; comes in like a knight in shining armor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const axios = require("axios")const { setDefaultResultOrder } = require("dns");setDefaultResultOrder("ipv4first");try { const { data } = await axios.get('http://localhost') // Success Response} catch (error) { console.log(error.message)}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Solution 3
&lt;/h1&gt;

&lt;p&gt;Degrading the version of Nodejs runtime to Nodejs 16 or lower can also fix the issue but it is not recommended.&lt;/p&gt;

&lt;h1&gt;
  
  
  Try Yourself
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://runkit.com/gitsambhal/nodejs-fix-error-connect-econnrefused-1-80-while-using-localhost"&gt;https://runkit.com/gitsambhal/nodejs-fix-error-connect-econnrefused-1-80-while-using-localhost&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Resolving the &lt;code&gt;connect ECONNREFUSED ::1:80&lt;/code&gt; error involves understanding the intricacies of local network configurations and resolving conflicts that prevent the successful connection of your Node.js application. By implementing the suggested troubleshooting steps and potential fixes, developers can overcome this error, ensuring uninterrupted progress in their development environment.&lt;/p&gt;

&lt;p&gt;We hope this guide helps you tackle the &lt;code&gt;connect ECONNREFUSED ::1:80&lt;/code&gt; error, enabling you to focus on building your Node.js applications without connectivity hurdles during local development.&lt;/p&gt;

&lt;p&gt;Stay tuned for more insightful troubleshooting tips and solutions!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Node.js Tutorial: Convert Currency Codes to Symbols in Seconds</title>
      <dc:creator>Suhail Akhtar</dc:creator>
      <pubDate>Sat, 29 Apr 2023 20:07:23 +0000</pubDate>
      <link>https://dev.to/sambhal/nodejs-tutorial-convert-currency-codes-to-symbols-in-seconds-2if4</link>
      <guid>https://dev.to/sambhal/nodejs-tutorial-convert-currency-codes-to-symbols-in-seconds-2if4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;Working with currency symbols can be tricky in any programming language, but especially so in Node.js. Fortunately, the &lt;code&gt;currency-symbol-map&lt;/code&gt; package provides an easy-to-use solution for handling currency symbols in your Node.js application. Whether you're building a financial application or simply need to display currency symbols in your UI, &lt;code&gt;currency-symbol-map&lt;/code&gt; can simplify the process for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation:
&lt;/h2&gt;

&lt;p&gt;To use &lt;code&gt;currency-symbol-map&lt;/code&gt; in your Node.js application, you first need to install it via npm. Open your terminal or command prompt and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install currency-symbol-map
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage:
&lt;/h2&gt;

&lt;p&gt;Once you've installed &lt;code&gt;currency-symbol-map&lt;/code&gt;, you can use it in your code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const currencySymbolMap = require('currency-symbol-map');console.log(currencySymbolMap('USD')); // outputs '$'console.log(currencySymbolMap('EUR')); // outputs ''console.log(currencySymbolMap('JPY')); // outputs ''
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, using &lt;code&gt;currency-symbol-map&lt;/code&gt; is as simple as requiring the package and passing in a currency code as a parameter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;

&lt;p&gt;Let's take a look at some practical examples of using &lt;code&gt;currency-symbol-map&lt;/code&gt; in real-world scenarios.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example 1: Displaying Currency Symbols in a UI
&lt;/h3&gt;

&lt;p&gt;Suppose you're building an e-commerce website and need to display the currency symbol next to the product price. You can easily accomplish this with &lt;code&gt;currency-symbol-map&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const currencySymbolMap = require('currency-symbol-map');const productPrice = 10.99;const currencyCode = 'USD';const currencySymbol = currencySymbolMap(currencyCode);console.log(`${currencySymbol}${productPrice}`); // outputs '$10.99'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example 2: Formatting Currency Values
&lt;/h3&gt;

&lt;p&gt;In this example, we have an array of products with different currencies. We use the &lt;code&gt;forEach&lt;/code&gt; method to loop through each product and get the currency symbol using the &lt;code&gt;currencySymbolMap&lt;/code&gt; package. We then format the price by concatenating the currency symbol with the price rounded to 2 decimal places using the &lt;code&gt;toFixed&lt;/code&gt; method. Finally, we log the name of the product and the formatted price to the console.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const currencySymbolMap = require('currency-symbol-map');const products = [{ name: 'Product A', price: 10.99, currencyCode: 'USD' }, { name: 'Product B', price: 9.99, currencyCode: 'EUR' }, { name: 'Product C', price: 15.99, currencyCode: 'JPY' }];products.forEach(product =&amp;gt; { const { name, price, currencyCode } = product; const currencySymbol = currencySymbolMap(currencyCode); const formattedPrice = `${currencySymbol}${price.toFixed(2)}`; console.log(`${name}: ${formattedPrice}`);});// Output:// Product A: $10.99// Product B: 9.99// Product C: 15.99
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;currency-symbol-map&lt;/code&gt; package provides a simple and effective way to work with currency symbols in your Node.js application. Whether you're working with financial data or simply need to display currency symbols in your UI, &lt;code&gt;currency-symbol-map&lt;/code&gt; can help you streamline your development process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.freepik.com/free-photo/world-international-golden-coin-currencies_3740833.htm#query=currency%20symbol&amp;amp;position=1&amp;amp;from_view=search&amp;amp;track=robertav1_2_sidr"&gt;Image by&lt;/a&gt; &lt;a href="http://rawpixel.com"&gt;rawpixel.com&lt;/a&gt; on Freepik&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Node.js Tutorial: How to Easily Convert Axios Requests to cURL Commands with axios-curlirize in Node.js and the Browser</title>
      <dc:creator>Suhail Akhtar</dc:creator>
      <pubDate>Sat, 29 Apr 2023 18:17:04 +0000</pubDate>
      <link>https://dev.to/sambhal/nodejs-tutorial-how-to-easily-convert-axios-requests-to-curl-commands-with-axios-curlirize-in-nodejs-and-the-browser-1f31</link>
      <guid>https://dev.to/sambhal/nodejs-tutorial-how-to-easily-convert-axios-requests-to-curl-commands-with-axios-curlirize-in-nodejs-and-the-browser-1f31</guid>
      <description>&lt;p&gt;Axios is a popular JavaScript library used for making HTTP requests from a web page or Node.js application. When developing APIs, it can be helpful to convert an Axios request to a cURL command for debugging or testing purposes. Fortunately, the &lt;code&gt;axios-curlirize&lt;/code&gt; npm package makes it easy to do just that. In this tutorial, we'll show you how to use &lt;code&gt;axios-curlirize&lt;/code&gt; to convert Axios requests to cURL commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we get started, make sure you have the following installed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Node.js (version 12 or higher)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;NPM (Node Package Manager)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installing axios-curlirize
&lt;/h2&gt;

&lt;p&gt;To use &lt;code&gt;axios-curlirize&lt;/code&gt;, you need to install it using NPM. Open your terminal and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install axios-curlirize
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using axios-curlirize
&lt;/h2&gt;

&lt;p&gt;Once you have &lt;code&gt;axios-curlirize&lt;/code&gt; installed, you can start using it to convert Axios requests to cURL commands. Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const axios = require('axios');const axiosCurlirize = require('axios-curlirize');axiosCurlirize(axios);axios.get('https://jsonplaceholder.typicode.com/posts/1') .then(response =&amp;gt; { console.log(response.data); }) .catch(error =&amp;gt; { console.error(error); });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we import &lt;code&gt;axios&lt;/code&gt; and &lt;code&gt;axios-curlirize&lt;/code&gt;. We then call &lt;code&gt;axiosCurlirize&lt;/code&gt; with the &lt;code&gt;axios&lt;/code&gt; instance as an argument to enable cURL logging for Axios requests. After that, we make a GET request to &lt;a href="https://jsonplaceholder.typicode.com/posts/1"&gt;&lt;code&gt;https://jsonplaceholder.typicode.com/posts/1&lt;/code&gt;&lt;/a&gt; using Axios.&lt;/p&gt;

&lt;p&gt;When you run this code, you'll see the cURL command for the Axios request logged to the console, along with the response data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ node app.js

$ curl 'https://jsonplaceholder.typicode.com/posts/1' -H 'User-Agent: axios/0.21.1' -H 'Accept: application/json, text/plain, */*' -H 'Host: jsonplaceholder.typicode.com' -H 'Connection: keep-alive'{ userId: 1, id: 1, title: 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit', body: 'quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's it! You can now use &lt;code&gt;axios-curlirize&lt;/code&gt; to convert your Axios requests to cURL commands for debugging or testing purposes. It's a simple and effective tool to have in your developer toolkit.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
