https://github.com/alsotang/simpledownload
A Node.js download package(library)
https://github.com/alsotang/simpledownload
Last synced: 3 months ago
JSON representation
A Node.js download package(library)
- Host: GitHub
- URL: https://github.com/alsotang/simpledownload
- Owner: alsotang
- Created: 2014-09-12T15:34:50.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-10-08T03:50:06.000Z (9 months ago)
- Last Synced: 2025-03-17T16:12:23.444Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 164 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/alsotang/simpledownload/actions/workflows/node.js.yml)
## Install
`npm install simpledownload`
## Usage
```js
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\
* `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.## dev
1. `$ npm run test`
2. bump package.json version
3. `$ npm publish`## license
MIT