@extfans/squoosh-upload
v1.0.1
Published
图片压缩上传
Downloads
5
Readme
@extfans/squoosh-upload
将图片压缩后再上传到七牛
如何使用
yarn add @extfans/squoosh-upload
根目录新建一个qiniu.json
文件:
{
"AK": "xxxx",
"SK": "xxxx",
"BUCKET": "xxx",
"ZONE": "xxx"
}
BUCKET
: 需要将图片上传的位置
ZONE
: 当前BUCKET的区域 Zone_z0(华东)
、Zone_z1(华北)
、Zone_z2(华南)
、Zone_na0(北美)
const squooshUpload = require('@extfans/squoosh-upload')
const imagePath = './test.jpeg'
const key = 'upload/test.jpg'
await squooshUpload({ imagePath, key })