<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aayan Ali on Medium]]></title>
        <description><![CDATA[Stories by Aayan Ali on Medium]]></description>
        <link>https://medium.com/@aayanali507?source=rss-82bf996939b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*l3p1BzP5oK_IT-CL3OBCGg.jpeg</url>
            <title>Stories by Aayan Ali on Medium</title>
            <link>https://medium.com/@aayanali507?source=rss-82bf996939b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 07 Jun 2026 10:50:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aayanali507/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Why can’t I change my Airpod behavior as a programmer?]]></title>
            <link>https://medium.com/@aayanali507/why-i-cant-change-my-airpod-behavior-as-a-programmer-2819b4666da2?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2819b4666da2</guid>
            <category><![CDATA[airpods]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-hardware]]></category>
            <category><![CDATA[linus-torvalds]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 10:56:21 GMT</pubDate>
            <atom:updated>2025-12-15T11:56:44.319Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>I had an interesting realization about “programming” and control over systems.</strong></p><p>I opened my Airpod cap and heard a beep sound from the box, the noise irritated me after some use.</p><p>I thought why can’t I stop it from making this noise?</p><p>I am a programmer, right? I have a Laptop with linux in it, why don’t edit the setting of my airpod?</p><p>We often say <em>“</em>everything is just a circuit<em>”</em>, so naturally the question comes up:<br> Why can’t I connect my laptop and change how my AirPods, microwave or TV behaves?</p><p>The answer surprised me; not at a theoretical level, but at a practical one.</p><p>Having a processor inside a device does not mean it’s programmable by the user. Most everyday electronics are <strong>closed appliances:</strong> bare metal firmware, no OS, data interface, bootloader, API. The logic is compiled once, locked, and shipped. There’s nothing listening on the other end of the USB cable often it’s not even a data port.</p><p>This made me think something deeper about people like <strong>Linus Torvalds</strong>.</p><p>Git was not magical because it was clever. It existed because Linus owned the whole stack. If you want real control, you do not hack black boxes you build your own boxes. Linux, Git, and similar tools weren’t built to be famous infact they became influential because they were correct, simple, and solved real problems from first principles.</p><p>For me, the takeaway is clear:</p><blockquote><strong><em>Control does not come from tweaking finished products. It comes from building the system itself.</em></strong></blockquote><p>That mindset shift alone changes how you look at software, hardware, and learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2819b4666da2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[While Loop in Python in easy words]]></title>
            <link>https://medium.com/@aayanali507/while-loop-in-python-in-easy-words-b7210f90eb3f?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7210f90eb3f</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[while-loop]]></category>
            <category><![CDATA[while-loop-in-python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[loops-in-python]]></category>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Fri, 26 Apr 2024 20:43:38 GMT</pubDate>
            <atom:updated>2024-04-26T20:43:38.699Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T6Q3gtlFYnuiNgKU3RvCrw.png" /></figure><p>Explain while loop in the easiest words possible.</p><p>Ok so take an example of daily life:</p><p>You are a chef cooking a soup,</p><p>you added 1000 ml of water to it,</p><p>your senior Chef ordered to get stirring until this water gets half,</p><p>you kept stirring, 1000 ml water turned almost 500 ml, and you stopped it from stirring.</p><p>This was a real-life example, Now you would say what is a while loop then?</p><p>You kept stirring until the water got to half, this is while loop.</p><p>You were stirring based on a condition, you will stop when the water in the soup will get half.</p><p>In a while loop, the body keeps on executing until the condition gets fulfilled.</p><p>You will keep on stirring until your condition is fulfilled. This is a while loop.</p><p>I hope you understood what is while loop in easy words.</p><p>Clap and follow me for more tutorial blogs like this!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7210f90eb3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Our Web Server In NodeJS]]></title>
            <link>https://blog.devgenius.io/creating-our-web-server-in-nodejs-768f10728e28?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/768f10728e28</guid>
            <category><![CDATA[https-node-js]]></category>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[first-server]]></category>
            <category><![CDATA[node-js-development]]></category>
            <category><![CDATA[nodejs-server]]></category>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Sat, 20 Apr 2024 15:15:11 GMT</pubDate>
            <atom:updated>2024-04-20T15:40:40.064Z</atom:updated>
            <content:encoded><![CDATA[<p>In this tutorial, we will create our first node js server, Excited right?</p><p>To make servers we use a Node JS package HTTP so let’s first import it:</p><pre>const http = require(&quot;http&quot;);</pre><p>You must have a strong knowledge of how websites work before creating the server.</p><p>Two things are going on:</p><ol><li>The user sends a request to the server</li><li>The server responds to the user</li></ol><pre>const server = http.createServer((req,res)=&gt;{<br>    res.end(&quot;hello this is my response&quot;);<br>})</pre><p>We have created a call-back function here, “req” stands for request, and “res” stands for response.</p><p>When I will request the server, in return it will give me a response which will be “hello this is my response”.</p><p>Now how will the server know that it needs to listen to the user requests, so we will add another code below:</p><pre>server.listen(8000,()=&gt;{<br>    console.log(&quot;listening to the port&quot;);<br>})</pre><p>We have created a call-back function.</p><p>Now we ordered the server to listen at port number 8000, there are many ports you can use any number.</p><p>Congrats you are done with creating a server in NodeJS, below is the complete code:</p><pre>const http = require(&quot;http&quot;);<br>const server = http.createServer((req,res)=&gt;{<br>    res.end(&quot;hello this is my response&quot;);<br>})<br><br>server.listen(8000,()=&gt;{<br>    console.log(&quot;listening to the port&quot;);<br>})</pre><p>Let&#39;s test it:</p><p>Write nodemon index.js or whatever your file name is in your terminal and run it.</p><p>Go to your browser and type:</p><p>localhost:8000 (If you have made any other port, change this number accordingly)</p><p>Click Enter and you will see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vcmHEucBiOoBB9592yQw2A.png" /></figure><p>In your terminal you will get this line:</p><p>“listening to the port” because you have printed this line in your “server.listen”.</p><p>I hope you understood how to create your own server.</p><p>Clap and follow me for more tutorials like this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=768f10728e28" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/creating-our-web-server-in-nodejs-768f10728e28">Creating Our Web Server In NodeJS</a> was originally published in <a href="https://blog.devgenius.io">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Nodemon in NodeJS?]]></title>
            <link>https://blog.devgenius.io/what-is-nodemon-in-nodejs-dbf093d9b29e?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbf093d9b29e</guid>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[nodemon]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[what-is-nodemon]]></category>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Fri, 19 Apr 2024 13:10:02 GMT</pubDate>
            <atom:updated>2024-04-19T17:19:45.948Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-TLGcffntq0CxsGssZ64w.png" /></figure><p>Tired of writing node again &amp; again to run the file and get output?</p><p>So presenting you, NODEMON !!!!</p><p>What is Nodemon?</p><p>Nodemon is a module in npm that automatically runs the file when any change in the file is made so you don’t need to write “node filename” again and again to run the file just to see your change.</p><p>How to use it?</p><p>As it is an NPM module you first need to install it by writing this command in your terminal:</p><pre>npm install nodemon -global</pre><p>What is this “global” in the above command?</p><p>When you write global with the command or package you are installing, the package will now install in your Operating system instead of your file where you are writing the code. Now after global, you will be able to use Nodemon anywhere not just in your current file.</p><p>To confirm your installation, write this command in your terminal:</p><pre>nodemon -v</pre><p>It will output the version of your nodemon.</p><p>If you are getting this error :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ywyIDInHFywjAv_9wCbLVw.png" /></figure><p>Just to the location it has provided:</p><p>“C: Users\aayan\AppData\Roaming\npm”</p><p>In the npm folder, you will find nodemon.ps1 file, just delete that file and you are done. Now when you run “nodemon -v” you won&#39;t get any error.</p><p>After the installation, to run your code now just write nodemon and your filename :</p><pre>nodemon index.js</pre><p>Make any edit in your file, it will automatically show you the output without running it.</p><p>To exit nodemon press Ctrl + C.</p><p>I hope you understood the use of Nodemon and how to use it in your file.</p><p>Give it a clap and follow me for more tutorials like this.</p><p>Go to my Portfolio to connect with me:</p><p><a href="https://aayan-ali-hashim.github.io/portfolio_website.github.io/">https://aayan-ali-hashim.github.io/portfolio_website.github.io/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbf093d9b29e" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/what-is-nodemon-in-nodejs-dbf093d9b29e">What is Nodemon in NodeJS?</a> was originally published in <a href="https://blog.devgenius.io">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is npm in NodeJS?]]></title>
            <link>https://blog.devgenius.io/what-is-npm-in-nodejs-e7210952444d?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7210952444d</guid>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[nodejs-development]]></category>
            <category><![CDATA[npm-package]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[npm-tutorial]]></category>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 08:47:05 GMT</pubDate>
            <atom:updated>2024-04-18T16:54:06.347Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ng1lAZ6mjWE2dfJAwcVV2A.png" /></figure><p>I will not use complex words here, my main focus is to explain you in easy words.</p><p>NPM(Node Package Manager) is a package manager of Node JS. Now what is a package manager?</p><p>There are many developers in the world,</p><p>If you have written code for any particular task and</p><p>don’t want others to write that code again for performing that task.</p><p>You will create your code package and put it on the NPM website (npmjs.com) where every npm package is available.</p><p>The user who wants to use your code can download it from the npm website and use it.</p><h3>How do you do all this in NodeJS?</h3><p>Let&#39;s use a chalk package in NodeJS:</p><ol><li>Create an index.js file,</li><li>Open your terminal and write “npm install chalk”,</li><li>By doing this you are downloading chalk from the website (npmjs.com),</li><li>After downloading,npm will create a folder of node_modules.</li><li>Now you can use the chalk package in your file just by importing it:</li></ol><pre>const chalk = require(&quot;chalk&quot;);</pre><p>Simply you are done with downloading the package using npm and using it in your code.</p><p>I hope you understood if yes then give a clap and follow me for more articles like this!</p><p>Contact:</p><p><a href="https://aayan-ali-hashim.github.io/portfolio_website.github.io/">https://aayan-ali-hashim.github.io/portfolio_website.github.io/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7210952444d" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/what-is-npm-in-nodejs-e7210952444d">What is npm in NodeJS?</a> was originally published in <a href="https://blog.devgenius.io">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Export and Import Modules in Node JS]]></title>
            <link>https://blog.devgenius.io/export-and-import-modules-in-node-js-2d7e9f893298?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d7e9f893298</guid>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[export-import-modules]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[node-js-development]]></category>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Tue, 16 Apr 2024 18:32:14 GMT</pubDate>
            <atom:updated>2024-04-17T17:32:19.239Z</atom:updated>
            <content:encoded><![CDATA[<h3>import Export and Import Modules in Node JS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MAGA2WdENrXOZstb_tU6XA.png" /></figure><p>In this tutorial, I will teach you how to export your functions and variables from one file and use them in another file by importing.</p><p><em>Buckle up your fingers with the keyboard and let’s get started !!</em></p><p>I will guide you from giving file names till getting the output so it will be better for you if you follow me exactly.</p><p>Create a folder “import_export” and make two files in it :</p><ol><li>index.js</li><li>functions.js</li><li>Open functions.js</li><li>Let’s make some functions in it :</li></ol><pre>// Function to add two numbers<br>const add = (a,b)=&gt;{<br>    return a+b;<br>}<br><br>// Function to subtract two numbers<br>const subtract= (a,b)=&gt;{<br>    return a-b;<br>}<br><br>// Function to multiply two numbers<br>const multiply = (a,b)=&gt;{<br>    return a*b;<br>}</pre><p>Now all these functions that we’ve created are private, not global. We can only access them in the functions.js file.</p><p>So if I want to use these functions in my index.js file, first we need to export them.</p><p>After functions add this line of code in your functions.js file:</p><pre>module.exports = {add,subtract,multiply};</pre><p>Now after exporting these functions, the scope has changed to global.</p><ol><li>Open index.js file</li><li>Now import the functions in this file:</li></ol><pre>const {add,subtract,multiply} = require(&#39;./functions&#39;);</pre><p>Congrats you are done with exporting and importing functions.</p><p>Let&#39;s try our functions in our index.js file:</p><pre>console.log(add(8,4));<br>console.log(subtract(8,4));<br>console.log(multiply(8,4));</pre><p>Inshallah! You will get the output of all these successfully.</p><p>I hope you understood everything in this tutorial. I tried my best to explain it in easy words.</p><p>If you have any questions you can ask me in the comments section.</p><p>Clap and follow me for more tutorials like this !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d7e9f893298" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/export-and-import-modules-in-node-js-2d7e9f893298">Export and Import Modules in Node JS</a> was originally published in <a href="https://blog.devgenius.io">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Path Module in Node JS]]></title>
            <link>https://blog.devgenius.io/path-module-in-node-js-1d93daf9b505?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d93daf9b505</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[node-js-development]]></category>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[nodejs-path-module-guide]]></category>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Tue, 16 Apr 2024 13:43:23 GMT</pubDate>
            <atom:updated>2024-04-16T15:49:30.000Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PF2vd9EDUwwRZQkddmTtrQ.png" /></figure><p>Let’s explore the Path module in Node JS and see what it does.</p><p>We will try some of the common and most useful functions of the Path module.</p><h3>Importing Path Module</h3><pre>const path = require(&#39;path&#39;);</pre><ol><li>To get the <strong>directory name</strong> of the path, we use dirname function:</li></ol><pre>console.log(path.dirname(&#39;C:/Users/aayan/Desktop/nodejs/PATH_MODULE/index.js&#39;));</pre><p>You can write your path in the inverted commas.</p><p><strong>WARNING: When you paste your path, it will contain back slashes so you need to convert it into forward slash!</strong></p><p>The Output I will get :</p><p>C:/Users/aayan/Desktop/Coding/nodejs/PATH_MODULE</p><p>This is giving you the directory(folder) of your file path.</p><p>2. To get the <strong>extension</strong> of your file use extname:</p><pre>console.log(path.extname(&#39;C:/Users/aayan/Desktop/nodejs/PATH_MODULE/index.js&#39;));</pre><p>The output I will get:</p><p>.js</p><p>This is giving you the extension of the file , if the file name is words.txt it will output “.txt”.</p><p>3. To get the <strong>file name</strong> use basename function:</p><pre>console.log(path.basename(&#39;C:/Users/aayan/Desktop/nodejs/PATH_MODULE/index.js&#39;));</pre><p>Output you will get:</p><p>index.js</p><p>To get all the <strong>information</strong> of the path use parse function:</p><pre>console.log(path.parse(&#39;C:/Users/aayan/Desktop/nodejs/PATH_MODULE/index.js&#39;));</pre><p>Output:</p><p>{</p><p>root: ‘C:/’,<br> dir: ’C:/Users/aayan/Desktop/nodejs/PATH_MODULE’,<br> base: ‘index.js’,<br> ext: ‘.js’,<br> name: ‘index’<br>}</p><p>This is an object :</p><ol><li>The root is giving the root directory</li><li>dir is giving directory ,the same ouput as dirname</li><li>base is providing the file name same as basename</li><li>ext is showing th extension of file ,same as extname</li><li>name is giving the name of file but notice it is giving the name without extension so do not confuse it with base.</li></ol><p>As I told you earlier this is an object so if you want to access any particular property you can do it like this:</p><p>Let’s suppose I just want to get the name:</p><pre>myObject = path.parse(&#39;C:/Users/aayan/Desktop/nodejs/PATH_MODULE/index.js&#39;));<br>console.log(my_object.name);</pre><p>I stored the object into the variable “myObject” and in the next line I accessed name property using a dot. If you know JavaScript , accessing object properties wouldn’t be difficult to understand for you.</p><p>I hope you understood and got to know the most useful functions of Path Module and how this module help us to get all the information about the path.</p><p>Clap it and follow me for more articles like this !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d93daf9b505" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/path-module-in-node-js-1d93daf9b505">Path Module in Node JS</a> was originally published in <a href="https://blog.devgenius.io">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node JS OS Module]]></title>
            <link>https://blog.devgenius.io/node-js-os-module-904f458035a6?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/904f458035a6</guid>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 23:31:54 GMT</pubDate>
            <atom:updated>2024-04-12T17:49:26.746Z</atom:updated>
            <content:encoded><![CDATA[<p>Node JS knows everything!</p><p>You can get all your information about your operating system just by typing code in Node JS.</p><p>So let&#39;s begin exploring the Node JS OS module:</p><p>Import the built-in OS module:</p><pre>const os = require(&#39;os&#39;);</pre><p>There are many functions in the OS module but we will use the common ones.</p><ol><li>To check what CPU OS architecture you have :</li></ol><pre>console.log(os.arch());</pre><p>2. Check free memory in your system:</p><pre>const freeMemory = os.freemem();<br>console.log(freeMemory);<br>console.log(`${freeMemory/1024/1024/1024}`);</pre><p>Store the value in the variable “freeMemory”, and output it, you will see a long number because you will get the answer in bytes. To convert bytes to gigabytes I divided the “freeMemory” variable by 1024 three times. If you know byte conversions you will understand it what I am doing here. Just giving a table for your help:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*IeSL0BGqWdNMP3SZzVPt6A.png" /></figure><p>3. Check the total memory in your system:</p><pre>const totalMemory = os.totalmem();<br>console.log(`${totalMemory/1024/1024/1024}`);</pre><p>It is also similar to freemem() function.</p><p>4. To get the hostname :</p><pre>console.log(os.hostname());</pre><p>5. To get the platform you are using whether macOS, Linux,or Windows:</p><pre>console.log(os.type());</pre><p>6. To get User information :</p><pre>console.log(os.userInfo());</pre><p>There are many other functions present in the OS module, go to the Node JS documentation and try it by yourself :</p><p><a href="https://nodejs.org/api/os.html">OS | Node.js v21.7.2 Documentation</a></p><p>Clap and follow me if you liked my tutorial !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=904f458035a6" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/node-js-os-module-904f458035a6">Node JS OS Module</a> was originally published in <a href="https://blog.devgenius.io">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Asynchronous CRUD operations using FS module in Node JS]]></title>
            <link>https://blog.devgenius.io/asynchronous-crud-operations-using-fs-module-in-node-js-469554529914?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/469554529914</guid>
            <category><![CDATA[crud-operations]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[asynchronous-programming]]></category>
            <category><![CDATA[asynchronous-javascript]]></category>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 17:31:33 GMT</pubDate>
            <atom:updated>2024-04-12T17:47:48.916Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2haxuA8_uYxux6SfBWwww.png" /></figure><p>In the last article, we studied synchronous CRUD operations :</p><p><a href="https://medium.com/@aayanali507/crud-operations-using-fs-module-in-nodejs-352e7fd1a598">Synchronous CRUD Operations using FS module in NodeJS</a></p><p>Here we will see CRUD operation using an asynchronous programming approach.</p><p>Import fs module:</p><pre>const fs = require(&#39;fs&#39;);</pre><h3>Creating a file</h3><p>Let’s create a file named “my_file.txt” and insert the “This is a file” text inside it.</p><pre> fs.writeFile(&quot;my_file.txt&quot;,&quot;This is a file.&quot;,(err)=&gt;<br>    console.log(&quot;File created successfully&quot;);<br>});</pre><p>In synchronous programming, we used fs.writeFile but here we are creating a call-back function.</p><h3>Reading a file</h3><p>Write the name of the file and its encoding inside:</p><pre>fs.readFile(&quot;my_file.txt&quot;,&quot;utf-8&quot;,(err,data)=&gt;{<br>  console.log(data);<br>});</pre><h3>Updating a file</h3><pre>fs.appendFile(&quot;my_file.txt&quot;,&quot;Updating it&quot;,(err)=&gt;{<br>  console.log(&quot;File updated successfully&quot;);<br>});</pre><p>Renaming a file is also a part of updating, let&#39;s do it:</p><p>First should be the current file name and the second argument will be the name you want to keep:</p><pre>fs.rename(&quot;my_file.txt&quot;,&quot;renamed_file.txt&quot;,(err)=&gt;{<br>console.log(&quot;File renamed successfully&quot;);<br>});</pre><h3>Deleting the file</h3><p>Just pass the name of the file and you are done with deleting the file:</p><pre>fs.unlink(&quot;renamed_file.txt&quot;,(err)=&gt;{<br>  console.log(&quot;File deleted successfully&quot;);<br>});</pre><p>GIVE IT A CLAP AND FOLLOW ME FOR MORE TUTORIALS LIKE THIS !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=469554529914" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/asynchronous-crud-operations-using-fs-module-in-node-js-469554529914">Asynchronous CRUD operations using FS module in Node JS</a> was originally published in <a href="https://blog.devgenius.io">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a new folder in NodeJS]]></title>
            <link>https://blog.devgenius.io/creating-a-new-folder-in-nodejs-cd2afe8c9f2b?source=rss-82bf996939b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd2afe8c9f2b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[node-js-development]]></category>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Aayan Ali]]></dc:creator>
            <pubDate>Fri, 05 Apr 2024 11:44:10 GMT</pubDate>
            <atom:updated>2024-04-12T17:53:03.631Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xnUyhbweSh5f7xaE" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Import the fs module from node JS using the code below:</p><pre>const fs = require(&#39;fs&#39;);</pre><p>Let’s make a folder named “nodejs”:</p><pre>fs.mkdir(&quot;nodejs&quot;,(err)=&gt;{<br>  console.log(&quot;Folder created successfully&quot;);<br>});</pre><p>DONE !!!</p><p>Simple and easy !!</p><p>Clap and follow me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd2afe8c9f2b" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/creating-a-new-folder-in-nodejs-cd2afe8c9f2b">Creating a new folder in NodeJS</a> was originally published in <a href="https://blog.devgenius.io">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>