2.1.0 • Published 6 years ago

capacitor-downloader v2.1.0

Weekly downloads
306
License
MIT
Repository
-
Last release
6 years ago

Capacitor Downloader

npm npm Build Status

Installation

  • npm i capacitor-downloader

Usage

import { Downloader } from 'capacitor-downloader';
const downloader = new Downloader();
const data = await downloader.createDownload({
  url:
    'https://wallpaperscraft.com/image/hulk_wolverine_x_men_marvel_comics_art_99032_3840x2400.jpg'
});
const imageDownloaderId = data.value;
downloader
  .start({id:imageDownloaderId}, (progressData: ProgressEventData) => {
    console.log(`Progress : ${progressData.value}%`);
    console.log(`Current Size : ${progressData.currentSize}%`);
    console.log(`Total Size : ${progressData.totalSize}%`);
    console.log(`Download Speed in bytes : ${progressData.speed}%`);
  })
  .then((completed: DownloadEventData) => {
    console.log(`Image : ${completed.path}`);
  })
  .catch(error => {
    console.log(error.message);
  });

Api

MethodDefaultTypeDescription
createDownload(options: DownloadOptions)Promise<Options>Creates a download task it returns the id of the task
getStatus(options:Options)Promise<StatusCode>Gets the status of a download task.
start(options:Options, progress?: Function)Promise<DownloadEventData>Starts a download task.
resume(options:Options)Promise<void>Resumes a download task.
cancel(options:Options)Promise<void>Cancels a download task.
pause(options:Options)Promise<void>Pauses a download task.
getPath(options:Options)Promise<void>Return the path of a download task.

Example Image

IOSAndroid
Coming SoonComing Soon

TODO

  • Local Notifications
2.1.0

6 years ago

2.0.0

6 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago