1.0.3 • Published 5 years ago

js-save-file v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

js-save-file

download files to save locally by JavaScript.

Installing

Using npm:

  npm install js-save-file

Using script:

  <script src="./dist/download.js"></script>

Example

import JSSaveFile from 'js-save-file'

const save = new JSSaveFile(url, '自定义下载图片名称')
save.init()
save.on('progress', ({ loaded, total }) => {
  console.log(`总字节数:${total} 已加载字节数:${loaded}`)
})
save.on('error', () => {
  console.log('下载失败')
})
save.on('complete', () => {
  this.$message('下载完成')
})

License

MIT

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago