1.1.0 • Published 11 months ago

@gap-l/batch-compress v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

batch-compress

Install

npm i @gap-l/batch-compress -D

Usage

const { batchCompress } = require('@gap-l/batch-compress');
batchCompress({
    // 需要压缩的图片路径
    inputArr: ['./images/**/*.png'],
    format: 'png', // 'jpeg' | 'jp2' | 'png' | 'webp' | 'gif' | 'avif' | 'heif' | 'tiff'
    // 压缩后的图片输出路径
    outputPath: `./outputImg`,
    outputConfig: {
        // docs: https://sharp.pixelplumbing.com/api-output#webp
        quality: 60,
    },
    maintainRelativePath: true,
})
1.1.0

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.0

11 months ago

1.0.4

11 months ago