Skip to content

Instantly share code, notes, and snippets.

@jhidalgo3
jhidalgo3 / downloader.js
Last active January 16, 2021 09:48
Use NodeJS to download files
var path = require('path');
var url = require('url');
var http = require('http');
var fs = require('fs');
var write_file;
//what global variable do we have?
var complete = false;
var content_length = 0;
var downloaded_bytes = 0;