jdf-img-minify
JDF 图片处理集成工具包
Install
$ npm install --save jdf-img-minify
Usage
jdfImg.all 自动根据文件扩展名压缩
/** * jdfImg.all(src,dist,withWebp,callback) */jdfImgall"src.png" "dist.png" true { console;} /** * jdfImg.all(src,dist,withWebp,quantity) * return Promise */jdfImgall"src.gif" "dist.gif" true "11";
手动指定压缩
/** * jdfImg.png(src,dist,quantity,callback) */jdfImg /** * jdfImg.png(src,dist,withWebp) * return Promise */jdfImg; //10 为压缩质量 默认 60-80jdfImg jdfImg; //gif has no quantity to setjdfImg jdfImg; //webp-png jdfImg jdfImg; //webp-gif jdfImg jdfImg;