# cordova-plugin-downloader2

> download using native

Latest version **0.0.6** (published 2018-03-21) · GPL license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-downloader2
pnpm add cordova-plugin-downloader2
yarn add cordova-plugin-downloader2
bun add cordova-plugin-downloader2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2018-03-21 |
| First published | 2018-03-18 |
| Weekly downloads | 0 |
| License | GPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zhangqingcai0815@gmail.com |
| Maintainers | ericzhang00 |
| Keywords | ecosystem:cordova, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-downloader2
- Repository: https://github.com/shougao/Cordova-plugin-downloader
- Homepage: https://github.com/shougao/Cordova-plugin-downloader#readme
- Issues: https://github.com/shougao/Cordova-plugin-downloader/issues
- npm.io page: https://npm.io/package/cordova-plugin-downloader2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.6 (latest) — 2018-03-21
- 0.0.5 — 2018-03-20
- 0.0.4 — 2018-03-20
- 0.0.3 — 2018-03-18
- 0.0.2 — 2018-03-18
- 0.0.1 — 2018-03-18

## README

# cordova-plugin-downloader2
Cordova downloader plugin for Android. The plugin reads url and refresh timer, download file and store in device storage. It can custom update download progress.

## install
```
cordova plugin add cordova-plugin-downloader2
```

## usage
``Downloader`` is a ``cordova.plugin.downloader.Downloader`` download progress will show on success(message)
```
function success(message){
    console.log("progress = " + message);
}

function error(message){
    console.log("error: reason is " + message);
}

url = "http://yourcompany.com/abc.apk";
Downloader.download(url, success, error);
```

the out put is json object, please using key ``UPDATE_PROGRESS``,``FILE_PATH`` and  ``ERROR`` to get the result.
```
{"UPDATE_PROGRESS":3}
{"UPDATE_PROGRESS":23}
{"UPDATE_PROGRESS":58}
{"UPDATE_PROGRESS":100}
```
the default refresh download progress is 500ms, you could set the timer using ``setRefreshTime``
```
Downloader.setRefreshTime(1000);
```
this plugin need get the two android premission
```
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
```

---
_Source: https://npm.io/package/cordova-plugin-downloader2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
