title: How to download a file (both http and https) and see/show download progress in real time in nodejs?
body: <p>First of all, I am a noob. I want to create an online downloader as part of my self-learning. I want to download files from both HTTP and HTTPS using nodejs. And I also want to show/see the progress of downloading. I there any way to do that.</p>
  
  <p>My Code</p>
  
  <pre><code>const http = require('http');
  const fs = require('fs');
  
  const file = fs.createWriteStream("file.jpg");
  const request = http.get("http://i3.ytimg.com/vi/J---aiyznGQ/mqdefault.jpg", function(response) {
    response.pipe(file);
  });
  </code></pre>