compress-image-by-tinify
v0.1.8
Published
A small tool that compresses images through tinypng and uploads qiniu
Downloads
6
Maintainers
Readme
一个将图片通过tinypng压缩之后上传到七牛云的小工具
使用方法
npm i compress-image-by-tinify or yarn add compress-image-by-tinify
const compressImageAndUpload = require('compressImageAndUpload')
const response = await compressImageAndUpload(key, token, timeout);
接受参数
- key tinypng 申请的key
- upload url 图床地址
- token 上传图床的token
- timeout 上传图床超时时间
返回值
具体返回的值由生成七牛云token时指定
缺点
由于tinypng压缩算法的问题 等待时间较长