simpledownload
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

Node.js CI

Install

npm install simpledownload

Usage

import {simpledownload} from 'simpledownload'
await simpledownload('https://www.google.co.jp/images/srpr/logo11w.png', `${__dirname}/1.jpg`);

simpledownload(url: string, localPath: string, options?: {timeout, agent}): Promise<void>

  • url - the url you wanna download. e.g https://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 use node-socks-proxy-agent to enable socks5 proxy.

license

MIT

/simpledownload/

    Package Sidebar

    Install

    npm i simpledownload

    Weekly Downloads

    8

    Version

    2.0.4

    License

    MIT

    Unpacked Size

    22.4 kB

    Total Files

    14

    Last publish

    Collaborators

    • alsotang