1.0.4 • Published 2 years ago

axios-downloader v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

🚀 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

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago