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

1.0.4Β β€’Β PublicΒ β€’Β Published

πŸš€ Features

  • πŸ³β€πŸŒˆ Downloading size: Monitor download size
  • πŸ“¦ Downloading downloadProgress: Monitor downloadProgress downloadProgress
  • ⚑ Downloading cancel: Cancel download

πŸ“¦ Install

npm i axios-downloader

πŸ¦„ Usage

import { ref } from 'vue'
import axios from 'axios'
import AxDownLoader from 'axios-downloader'

// Options
const AxDownLoaderOption = ref({
  url: 'https://images.unsplash.com/photo-1663529628961-80aa6ebcd157?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=764&q=80',
  fileName: 'test',
  fileSize: 0,
  downloadSize: 0,
  downloadProgress: 0,
  cancel: null,
})

// downLoad
const downLoad = function () {
  AxDownLoader(AxDownLoaderOption.value)
    .then((res) => {
      console.log('downLoad success', res)
    })
    .catch((err) => {
      console.log('downLoad faild', err)
    })
}
// cancel
const cancel = function () {
  AxDownLoaderOption.value.cancel()
}

🐱 Demo

AxDownLoader

Package Sidebar

Install

npm i axios-downloader

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

7.21 kB

Total Files

6

Last publish

Collaborators

  • suqiqi