Skip to content

Instantly share code, notes, and snippets.

View sandeshjangam's full-sized avatar
🎯
Focusing

Sandesh sandeshjangam

🎯
Focusing
View GitHub Profile
@gkhays
gkhays / Download File with Node.md
Created February 27, 2020 17:26
Download a file from a URL using Node.js

Download File from URL

Proof-of-concept to download a file from a URL and save it locally. For example, I may wish to retrieve a JAR file from Nexus.

Uses the http package, which does the basics with raw HTTP protocol support.

Possible update: use request, it is like the Python's requests library. There is a companion package called node-request-progress that tracks download progress. See request-progress on GitHub.

Note: The request package has been deprecated.