async-downloader
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

async-downloader

A lightweight webworker-based download utility for asynchronously loading content in web applications

Installing

Using npm:

$ npm install async-downloader

Using bower:

$ bower install async-downloader

Using yarn:

$ yarn add async-downloader

Usage

import Downloader from 'async-downloader'

const downloader = new Downloader()

const blobUri = await downloader.download('https://via.placeholder.com/150')
<img src="{{blobUri}}" />

Options

new Downloader({
  returnType: 'blob | uri',
  workerUri: '/scripts/download.worker.js',
})
Option Description Default
returnType The desired return-type for the file being downloaded (blob or uri) uri
workerUrl The path to the web worker script (modify if you want to use your own CDN) https://cdn.jsdelivr.net/npm/async-downloader/workers/download.worker.js

Package Sidebar

Install

npm i async-downloader

Weekly Downloads

7

Version

0.0.1

License

MIT

Unpacked Size

8.43 kB

Total Files

11

Last publish

Collaborators

  • thealexpatin