node program to download files in a loop