<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Tech on Imran Khan</title>
    <link>https://imran-khan.com/categories/tech/</link>
    <description>Recent content in Tech on Imran Khan</description>
    <generator>Hugo -- 0.127.0</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 17 Apr 2019 06:21:27 +0000</lastBuildDate>
    <atom:link href="https://imran-khan.com/categories/tech/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Working with streams in NodeJS</title>
      <link>https://imran-khan.com/posts/working-with-streams-in-nodejs/</link>
      <pubDate>Wed, 17 Apr 2019 06:21:27 +0000</pubDate>
      <guid>https://imran-khan.com/posts/working-with-streams-in-nodejs/</guid>
      <description>What are Streams ?
Streams are just collections of data that is sent in small chunks, and it also don&amp;rsquo;t have to fit in memory. Meaning, when dealing with big chunk of data either read or write, the memory usage is less consumed, which is extremely useful.
let me show two examples how streams can be optimized the memory consumption.
writeStream.js
const fs = require(&amp;#39;fs&amp;#39;); const file = fs.createWriteStream(&amp;#39;file.txt&amp;#39;); for(let i=0; i&amp;lt;=2e6; i++) { file.</description>
    </item>
  </channel>
</rss>
