Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7579455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:41:05+00:00 2026-05-30T17:41:05+00:00

I recently asked/accepted an answer to a question I had earlier: How can I

  • 0

I recently asked/accepted an answer to a question I had earlier: How can I replicate the functionality of a wget with nodejs.

Now, my script is functioning perfectly, but I’d like to be able to show the user the percentage that’s downloaded. I’m not sure if that’s exposed to us (I didn’t see it in the docs), but I figured I’d ask here anyways. Would love some help!

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:41:07+00:00Added an answer on May 30, 2026 at 5:41 pm

    Yes, you can. With child_process.spawn. While child_process.exec executes the command and buffers the output, spawn gives you events on data, error and end. So you can listen to that and calculate your progress. There’s a basic example in the node docs for spawn.

    Update: I saw your other question. You can use wget for this, but I recommend the nodejs module request instead. Here’s how to fetch the file with request:

    var request = require("request");
    
    request(url, function(err, res, body) {
      // Do funky stuff with body
    });
    

    If you want to track progress, you pass a callback to onResponse:

    function trackProgress(err, res) {
      if(err)
        return console.error(err);
    
      var contentLength = parseInt(res.headers["content-length"], 10),
          received = 0, progress = 0;
      res.on("data", function(data) {
        received += data.length;
        progress = received / contentLength;
        // Do funky stuff with progress
      });
    }
    
    request({url: url, onResponse: trackProgress}, function(err, res, body) {
      // Do funky stuff with body
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently asked this question on here and got the answer. However I'm now
I recently asked a question about what I called method calls. The answer referred
I recently asked a question here, and someone provided this answer: private void button1_Click(object
I recently asked this question regarding pulling beans out of an applicationContext. The answer
I've recently asked a question on StackoverFlow about the MVC: Can the MVC Design
Please see here for a question I recently asked. The only answer you should
I recently asked a question about Self-Joins and I got a great answer. The
I recently asked a question about LAMP stack not allowing posting of <script> tag
I recently asked a question about counting the number of times an element had
I recently asked a question about committing a new file but now I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.