Downloads a file from a URL using HTTPS. Automatically handles HTTP redirects (301, 302).
The URL to download from
The downloaded file content as a string
If download fails or HTTP status is not 200/301/302
const testlibContent = await downloadFile( 'https://raw.githubusercontent.com/MikeMirzayanov/testlib/master/testlib.h');fs.writeFileSync('testlib.h', testlibContent); Copy
const testlibContent = await downloadFile( 'https://raw.githubusercontent.com/MikeMirzayanov/testlib/master/testlib.h');fs.writeFileSync('testlib.h', testlibContent);
Downloads a file from a URL using HTTPS. Automatically handles HTTP redirects (301, 302).