Skip to content

Instantly share code, notes, and snippets.

View arip1997's full-sized avatar
:shipit:
StudentNewbie

Arif Rahmat Santoso arip1997

:shipit:
StudentNewbie
View GitHub Profile
@arip1997
arip1997 / download.js
Created December 18, 2019 15:51 — forked from falkolab/download.js
Download file by http with progress (NodeJS)
function download(fileUrl, apiPath, callback) {
var url = require('url'),
http = require('http'),
p = url.parse(fileUrl),
timeout = 10000;
var file = fs.createWriteStream(apiPath);
var timeout_wrapper = function( req ) {
return function() {