Sunday, 19 January 2020

How to download files with vanilla JavaScript?

I'm writing a node application to download files given paths (it could be in http, https, ftp, sftp). Since, the protocols could be added later, I'm trying to do it in a generic and scalable way with as little libraries as possible.I have looked into some S/O questions but some of them require http modules to work with or some require axios or third-party libs. I also tried to use net.Socket but it doesn't seem to be the correct way to do it.So, I'm wondering if there're generic ways to achive this? fs and other vanilla node modules are fine.Thanks!

Submitted January 19, 2020 at 10:35AM by Thammarith

No comments:

Post a Comment