Socket
Socket
Sign inDemoInstall

optimage-cli

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

optimage-cli

Optimize images for the web


Version published
Maintainers
1
Created
Source

Optimage

Installation

npm install -D optimage-cli

Usage

npx optimage-cli "{path}" "{ignore}" [--config=path/to/config.json]

Argument

ArgumentDescriptionExample
pathA Glob pattern that match all files to optimize.`"images/**/*.@(png
ignoreA Glob pattern that match files to ignore."images/raw/*"

Options

OptionDescriptionExample
--configRelative or absolute path the a JSON config file.optimage.json

Example usage

node optimage "images/**/*.@(png|jpg|jpeg|gif|webp)" "images/raw/**/*" --config=optimage.json

Optimize all png and jpeg image files in ./images exept those in the ./images/raw folder using configuration from optimage.json.

Configuration

EntryDescription
cacheSharp cache configuration
optionsSharp images options (applied to all formats)
jpegSharp jpeg options
pngSharp png options
webpSharp webp options
gifSharp gif options

Example configuration

optimage.json:

{
  "cache": {
    "memory":  500
  },
  "options": {
    "quality": 80
  },
  "png": {
    "compressionLevel": 9
  },
  "webp": {
    "reductionEffort": 6
  },
  "jpeg": {
    "quality": 75
  }
}

Keywords

FAQs

Package last updated on 11 Feb 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