Socket
Socket
Sign inDemoInstall

js-save-file

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    js-save-file

download files to save locally by JavaScript.


Version published
Weekly downloads
7
Maintainers
1
Install size
10.8 kB
Created
Weekly downloads
 

Readme

Source

js-save-file

Version License Downloads

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

Keywords

FAQs

Last updated on 08 Apr 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