New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qiniu-web-uploader

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qiniu-web-uploader - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "qiniu-web-uploader",
"version": "2.0.0",
"version": "2.0.1",
"description": "七牛上传模块",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -15,8 +15,26 @@ # 七牛上传模块[![Build Status](https://travis-ci.org/conglai/qiniu-web-uploader.svg?branch=master)](https://travis-ci.org/conglai/qiniu-web-uploader)

```js
import { UploaderQueue } from 'qiniu-web-uploader';
import Uploader from 'qiniu-web-uploader';
let queue = new UplUploaderQueue();
queue.push(file, uptoken); // file为input,只能压缩图片,uptoken为七牛上传凭证
/*
{
uptoken: 'asdfsdf', //七牛上传凭证
key: 'sdfa' //base63字符串
}
*/
let uploader = new Uploader(file, uptoken);
queue.runUpload()
uploader.on('progress', () => {
console.log(uploader.percent); //加载进度
console.log(uploader.offset); //字节
console.log(uploader.file); //文件
});
uploader.on('cancel', () => {
//取消
});
uploader.on('complete', () => {
console.log(uploader.imgRes); //文件
});
let imgRes = await uploader.upload(); //返回七牛返回的Key
uploader.cancel(); //取消
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc