Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 7
    the callback is confusing me. if I now invoke download(), how would I do it? What would I place as the cb argument? I have the download('someURI', '/some/destination', cb) but don't understand what to put in the cb Commented Mar 6, 2016 at 22:43
  • 3
    @Abdul You specify the callback with a function only if you need to do something when the file has been successfully fetched. Commented May 17, 2016 at 10:57
  • It would be good to check the status code before saving: response.statusCode == 200 Commented Sep 18, 2021 at 23:26