Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alsotang/simpledownload
A Node.js download package(library)
https://github.com/alsotang/simpledownload
Last synced: 2 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 (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-10-07T18:36:41.000Z (3 months ago)
- Last Synced: 2024-10-07T18:40:25.215Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 125 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Node.js CI](https://github.com/alsotang/simpledownload/actions/workflows/node.js.yml/badge.svg)](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