npm install simpledownload
import {simpledownload} from 'simpledownload'
await simpledownload('https://www.google.co.jp/images/srpr/logo11w.png', `${__dirname}/1.jpg`);
url
- the url you wanna download. e.ghttps://www.google.co.jp/images/srpr/logo11w.png
localPath
- e.g`${__dirname}/1.jpg`
options.timeout
- use millisecond. If timeout,err.timeout
would exist.options.agent
-http.Agent
. For example, you can usenode-socks-proxy-agent
to enable socks5 proxy.
MIT