Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gap-l/batch-compress

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gap-l/batch-compress

An image batch processing tool based on fast-glob and sharp.js, mainly used for image compression and format conversion

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

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

Keywords

FAQs

Package last updated on 04 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc