1.0.1 • Published 2 years ago

@extfans/squoosh-upload v1.0.1

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

@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 })