zax-compress
v1.0.7
Published
dsp team compress tools
Downloads
11
Maintainers
Readme
ZAX Compress images
compress & base64 images of [jpeg|jpg|gif|webp]
install
npm i zax-compress -D
use
const compress = require('zax-compress')
# tiny
compress.tiny({
quality: 75,
convertToWebp:true,
enumFormat: ['.jpeg', '.jpg', '.png'],
imageSrc: path.resolve(__dirname, 'src'),
imageDist: path.resolve(__dirname, 'dist'),
})
# base64
compress.base64({
enumFormat: ['.jpeg', '.jpg', '.png'],
imageSrc: path.resolve(__dirname, 'src'),
imageDist: path.resolve(__dirname, 'dist'),
})
# clean
compress.base64({
imageDist: path.resolve(__dirname, 'dist'),
})
TODO
- print compress loss log