Socket
Socket
Sign inDemoInstall

capacitor-downloader

Package Overview
Dependencies
2
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    capacitor-downloader

[![npm](https://img.shields.io/npm/v/capacitor-downloader.svg)](https://www.npmjs.com/package/capacitor-downloader) [![npm](https://img.shields.io/npm/dt/capacitor-downloader.svg?label=npm%20downloads)](https://www.npmjs.com/package/capacitor-downloader)


Version published
Weekly downloads
82
decreased by-4.65%
Maintainers
1
Install size
546 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 21 May 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc